- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 26 for ResponseBody (0.17 sec)
-
okhttp/src/jvmTest/kotlin/okhttp3/ResponseJvmTest.kt
*/ package okhttp3 import assertk.assertThat import assertk.assertions.isEmpty import assertk.assertions.isEqualTo import kotlin.test.assertFailsWith import okhttp3.ResponseBody.Companion.asResponseBody import okhttp3.ResponseBody.Companion.toResponseBody import okio.Buffer import okio.BufferedSource import okio.Source import okio.Timeout import okio.buffer import org.junit.jupiter.api.Test
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Jul 07 18:57:05 UTC 2025 - 2.8K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/DuplexTest.kt
val responseBody = response.body.source() assertThat(responseBody.readUtf8Line()) .isEqualTo("response A") assertThat(responseBody.readUtf8Line()) .isEqualTo("response B") requestBody.writeUtf8("request C\n") requestBody.close() assertThat(responseBody.readUtf8Line()).isNull() } body.awaitSuccess() }
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Jun 18 12:28:21 UTC 2025 - 24.8K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Response.kt
* [closed][ResponseBody] and may be consumed only once. * * If this is a [cacheResponse], [networkResponse], or [priorResponse], the server's response body * is not available, and it is always an error to attempt read its streamed content. Reading from * [ResponseBody.source] always throws on such instances. * * It is safe and supported to call [ResponseBody.contentType] and [ResponseBody.contentLength] on
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Jul 28 14:39:28 UTC 2025 - 18.1K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/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 Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jun 21 20:36:35 UTC 2025 - 46.5K bytes - Viewed (0) -
okhttp/api/jvm/okhttp.api
public final fun create (Lokhttp3/MediaType;JLokio/BufferedSource;)Lokhttp3/ResponseBody; public final fun create (Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/ResponseBody; public final fun create (Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/ResponseBody; public final fun create (Lokhttp3/MediaType;[B)Lokhttp3/ResponseBody; public final fun create (Lokio/BufferedSource;Lokhttp3/MediaType;J)Lokhttp3/ResponseBody;
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 16 09:39:51 UTC 2025 - 69.4K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/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() } @Test fun forciblyStopDispatcher() { client = client .newBuilder()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 30 11:30:11 UTC 2025 - 6.1K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/TrailersTest.kt
} private fun peekTrailers(protocol: Protocol) { val responseBody = "a".repeat(OKHTTP_CLIENT_WINDOW_SIZE) enableProtocol(protocol) server.enqueue( MockResponse .Builder() .addHeader("h1", "v1") .trailers(headersOf("t1", "v2")) .body(protocol, responseBody) .build(), ) val call = client.newCall(Request(server.url("/")))
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Jul 07 18:57:05 UTC 2025 - 18K bytes - Viewed (0) -
okhttp/api/android/okhttp.api
public final fun create (Lokhttp3/MediaType;JLokio/BufferedSource;)Lokhttp3/ResponseBody; public final fun create (Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/ResponseBody; public final fun create (Lokhttp3/MediaType;Lokio/ByteString;)Lokhttp3/ResponseBody; public final fun create (Lokhttp3/MediaType;[B)Lokhttp3/ResponseBody; public final fun create (Lokio/BufferedSource;Lokhttp3/MediaType;J)Lokhttp3/ResponseBody;
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 16 09:39:51 UTC 2025 - 69.4K bytes - Viewed (0) -
okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt
}, ) throw e } val tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs) val responseBody = response.body!! val contentLength = responseBody.contentLength() val bodySize = if (contentLength != -1L) "$contentLength-byte" else "unknown-length" logger.log( buildString { append("<-- ${response.code}")
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Aug 21 14:27:04 UTC 2025 - 11.4K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http/CallServerInterceptor.kt
if (isUpgradeRequest) { exchange.noRequestBody() // Failed upgrade request has no outbound data. } val responseBody = exchange.openResponseBody(response) response .newBuilder() .body(responseBody) .trailers( object : TrailersSource { override fun peek() = exchange.peekTrailers()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Tue Jul 29 22:04:11 UTC 2025 - 7.8K bytes - Viewed (0)