- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for peekBody (0.04 sec)
-
okhttp/src/jvmTest/kotlin/okhttp3/ResponseCommonTest.kt
val response = newResponse(responseBody("abcdef")) val peekedBody = response.peekBody(3) assertThat(peekedBody.string()).isEqualTo("abc") assertThat(response.body.string()).isEqualTo("abcdef") } @Test fun peekLongerThanResponse() { val response = newResponse(responseBody("abc")) val peekedBody = response.peekBody(6) assertThat(peekedBody.string()).isEqualTo("abc")
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 3.6K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/ResponseJvmTest.kt
} @Test fun peekAfterReadingResponse() { val response = newResponse(responseBody("abc")) assertThat(response.body.string()).isEqualTo("abc") assertFailsWith<IllegalStateException> { response.peekBody(3) } } /** * Returns a new response body that refuses to be read once it has been closed. This is true of * most [BufferedSource] instances, but not of [Buffer]. */
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/KotlinSourceModernTest.kt
val header: String? = response.header("") val headers: Headers = response.headers val trailers: Headers = response.trailers() val peekBody: ResponseBody = response.peekBody(0L) val body: ResponseBody = response.body val builder: Response.Builder = response.newBuilder() val redirect: Boolean = response.isRedirect
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/src/commonJvmAndroid/kotlin/okhttp3/Response.kt
* * **Warning:** this method loads the requested bytes into memory. Most applications should set * a modest limit on `byteCount`, such as 1 MiB. */ @Throws(IOException::class) fun peekBody(byteCount: Long): ResponseBody { val peeked = body.source().peek() val buffer = Buffer() peeked.request(byteCount) buffer.write(peeked, minOf(byteCount, peeked.buffer.size))
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/api/jvm/okhttp.api
public final fun isSuccessful ()Z public final fun message ()Ljava/lang/String; public final fun networkResponse ()Lokhttp3/Response; public final fun newBuilder ()Lokhttp3/Response$Builder; public final fun peekBody (J)Lokhttp3/ResponseBody; public final fun peekTrailers ()Lokhttp3/Headers; public final fun priorResponse ()Lokhttp3/Response; public final fun protocol ()Lokhttp3/Protocol;
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 16 09:39:51 UTC 2025 - 69.4K bytes - Viewed (0) -
docs/changelogs/changelog_3x.md
forbidden by `URI`. * Fix: When a connect times out, attempt an alternate route. Previously route selection was less efficient when differentiating failures. * New: `Response.peekBody()` lets you access the response body without consuming it. This may be handy for interceptors! * New: `HttpUrl.newBuilder()` resolves a link to a builder. * New: Add the TLS version to the `Handshake`.
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sun Feb 06 14:55:54 UTC 2022 - 50.8K bytes - Viewed (0) -
okhttp/api/android/okhttp.api
public final fun isSuccessful ()Z public final fun message ()Ljava/lang/String; public final fun networkResponse ()Lokhttp3/Response; public final fun newBuilder ()Lokhttp3/Response$Builder; public final fun peekBody (J)Lokhttp3/ResponseBody; public final fun peekTrailers ()Lokhttp3/Headers; public final fun priorResponse ()Lokhttp3/Response; public final fun protocol ()Lokhttp3/Protocol;
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 16 09:39:51 UTC 2025 - 69.4K bytes - Viewed (0)