- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 56 for ResponseBody (0.12 sec)
-
okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt
val bytes = responseBody.bytes() val charStream = responseBody.charStream() val string = responseBody.string() responseBody.close() responseBody = "".toResponseBody("".toMediaType()) responseBody = "".toResponseBody(null) responseBody = ByteString.EMPTY.toResponseBody("".toMediaType()) responseBody = ByteString.EMPTY.toResponseBody(null)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 01 14:21:25 UTC 2024 - 46.5K bytes - Viewed (0) -
mockwebserver/src/main/kotlin/mockwebserver3/internal/duplex/MockStreamHandler.kt
s: String, responseSent: CountDownLatch = CountDownLatch(0), ) = apply { actions += { stream -> stream.responseBody.writeUtf8(s) stream.responseBody.flush() responseSent.countDown() } } fun exhaustResponse() = apply { actions += { stream -> stream.responseBody.close() } } fun sleep( duration: Long, unit: TimeUnit, ) = apply {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 3.2K bytes - Viewed (0) -
docs/changelogs/upgrading_to_okhttp_4.md
| RequestBody.create(String) | String.toRequestBody() | | ResponseBody.create(BufferedSource) | BufferedSource.asResponseBody() | | ResponseBody.create(ByteArray) | ByteArray.toResponseBody() | | ResponseBody.create(ByteString) | ByteString.toResponseBody() | | ResponseBody.create(String) | String.toResponseBody() | SAM Conversions ---------------
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 06 16:58:16 UTC 2022 - 10.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt
val response = call.execute() cancelLater(call, 500) val responseBody = response.body.byteStream() val buffer = ByteArray(1024) assertFailsWith<IOException> { while (responseBody.read(buffer) != -1) { } }.also { expected -> assertEquals(cancelMode == INTERRUPT, Thread.interrupted()) } responseBody.close()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 20 10:30:28 UTC 2024 - 9.9K bytes - Viewed (0) -
fess-crawler/src/main/java/org/codelibs/fess/crawler/entity/ResponseData.java
} } return null; } public void setResponseBody(final byte[] responseBody) { responseBodyBytes = responseBody; } public void setResponseBody(final File responseBody, final boolean isTemporary) { responseBodyFile = responseBody; isTemporaryFile = isTemporary; } public String getCharSet() { return charSet; }
Registered: Sun Nov 10 03:50:12 UTC 2024 - Last Modified: Sat Oct 12 01:40:57 UTC 2024 - 5.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt
.build(), ) val response = call.execute() interruptLater(500) val responseBody = response.body.byteStream() val buffer = ByteArray(1024) assertFailsWith<IOException> { while (responseBody.read(buffer) != -1) { } } responseBody.close() } private fun sleep(delayMillis: Int) { try { Thread.sleep(delayMillis.toLong())
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 4.6K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/Call.kt
/** * Invokes the request immediately, and blocks until the response can be processed or is in error. * * To avoid leaking resources callers should close the [Response] which in turn will close the * underlying [ResponseBody]. * * ```java * // ensure the response (and underlying response body) is closed * try (Response response = client.newCall(request).execute()) { * ... * } * ``` *
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Dec 20 23:27:07 UTC 2023 - 3.6K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/AsynchronousGet.java
@Override public void onFailure(Call call, IOException e) { e.printStackTrace(); } @Override public void onResponse(Call call, Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); Headers responseHeaders = response.headers();
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun May 22 01:29:42 UTC 2016 - 1.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/ResponseBodyTest.kt
assertThat(source.exhausted()).isTrue() assertThat(source.readUtf8()).isEqualTo("") } @Test fun sourceClosesUnderlyingSource() { var closed = false val body: ResponseBody = object : ResponseBody() { override fun contentType(): MediaType? { return null } override fun contentLength(): Long { return 5 }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 4K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/http/RealResponseBody.kt
import okhttp3.ResponseBody import okio.BufferedSource class RealResponseBody( /** * Use a string to avoid parsing the content type until needed. This also defers problems caused * by malformed content types. */ private val contentTypeString: String?, private val contentLength: Long, private val source: BufferedSource, ) : ResponseBody() {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.2K bytes - Viewed (0)