- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 19 for cacheResponse (0.11 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
okhttp/src/jvmTest/kotlin/okhttp3/RecordedResponse.kt
fun assertNoCacheResponse() = apply { assertThat(response!!.cacheResponse).isNull() } /** * Asserts that the current response used the cache and returns the cache response. */ fun cacheResponse(): RecordedResponse { val cacheResponse = response!!.cacheResponse!! return RecordedResponse(cacheResponse.request, cacheResponse, null, null, null) }
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Fri Dec 27 13:39:56 GMT 2024 - 5.3K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Response.kt
checkSupportResponse("networkResponse", networkResponse) this.networkResponse = networkResponse } open fun cacheResponse(cacheResponse: Response?) = apply { checkSupportResponse("cacheResponse", cacheResponse) this.cacheResponse = cacheResponse } private fun checkSupportResponse( name: String, response: Response?, ) { response?.apply {
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Mon Jul 28 14:39:28 GMT 2025 - 18.1K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache/CacheInterceptor.kt
if (networkRequest == null) { return cacheResponse!! .newBuilder() .cacheResponse(cacheResponse.stripBody()) .build() .also { call.eventListener.cacheHit(call, it) } } if (cacheResponse != null) { call.eventListener.cacheConditionalHit(call, cacheResponse) } else if (cache != null) { call.eventListener.cacheMiss(call)
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 10.3K bytes - Click Count (0) -
docs/features/caching.md
received followed by a cache hit or miss. Critically in the cache hit scenario the server won’t send the response body. The response will have non-null `cacheResponse` and `networkResponse`. The cacheResponse will be used as the top level response only if the response code is HTTP/1.1 304 Not Modified. - CallStart - **CacheConditionalHit** - ConnectionAcquired - ... Standard Events...
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Sun Feb 06 02:19:09 GMT 2022 - 3.1K bytes - Click Count (1) -
docs/recipes.md
[CacheResponseJava]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/CacheResponse.java [CacheResponseKotlin]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/kt/CacheResponse.kt [CancelCallJava]: https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/CancelCall.java
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Sat Aug 30 17:01:12 GMT 2025 - 47.8K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/UnreadableResponseBody.kt
sink: Buffer, byteCount: Long, ): Long = throw IllegalStateException( """ |Unreadable ResponseBody! These Response objects have bodies that are stripped: | * Response.cacheResponse | * Response.networkResponse | * Response.priorResponse | * EventSourceListener | * WebSocketListener |(It is safe to call contentType() and contentLength() on these response bodies.)Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Tue May 27 15:19:53 GMT 2025 - 1.7K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/KotlinDeprecationErrorTest.kt
val headers: Headers = response.headers() val body: ResponseBody = response.body() val networkResponse: Response? = response.networkResponse() val cacheResponse: Response? = response.cacheResponse() val priorResponse: Response? = response.priorResponse() val cacheControl: CacheControl = response.cacheControl() val sentRequestAtMillis: Long = response.sentRequestAtMillis()
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Fri Dec 27 13:39:56 GMT 2024 - 13.3K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt
val builder: Response.Builder = response.newBuilder() val redirect: Boolean = response.isRedirect val networkResponse: Response? = response.networkResponse val cacheResponse: Response? = response.cacheResponse val priorResponse: Response? = response.priorResponse val challenges: List<Challenge> = response.challenges() val cacheControl: CacheControl = response.cacheControl
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 47K bytes - Click Count (0) -
android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt
assertNull(it.cacheResponse) assertNotNull(it.networkResponse) assertEquals(3, it.cacheControl.maxAgeSeconds) assertTrue(it.cacheControl.isPublic) } client .newCall(request) .execute() .use { assertEquals(200, it.code) assertNotNull(it.cacheResponse) assertNull(it.networkResponse)
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Tue Nov 04 19:13:52 GMT 2025 - 29.9K bytes - Click Count (0) -
docs/changelogs/upgrading_to_okhttp_4.md
* **PushPromise**: headers, method, path, response * **Request**: body, cacheControl, headers, method, url * **Response**: body, cacheControl, cacheResponse, code, handshake, headers, message, networkResponse, priorResponse, protocol, receivedResponseAtMillis, request, sentRequestAtMillis * **Route**: address, proxy, socketAddress * **TlsVersion**: javaName
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Sun Feb 06 16:58:16 GMT 2022 - 10.9K bytes - Click Count (0)