- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for peekBody (0.12 sec)
-
okhttp/src/test/java/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 Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 3.6K bytes - Viewed (0) -
okhttp/src/test/java/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 Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 3.1K bytes - Viewed (0) -
okhttp/src/main/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 Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jul 06 09:38:30 UTC 2024 - 15.6K bytes - Viewed (0) -
okhttp/src/test/java/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 Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 01 14:21:25 UTC 2024 - 46.5K 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 Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Feb 06 14:55:54 UTC 2022 - 50.8K bytes - Viewed (0) -
okhttp/api/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 priorResponse ()Lokhttp3/Response; public final fun protocol ()Lokhttp3/Protocol; public final fun receivedResponseAtMillis ()J public final fun request ()Lokhttp3/Request;
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 15 13:41:01 UTC 2024 - 70.2K bytes - Viewed (0)