Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for cacheUrlOverride (0.27 sec)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/Request.kt

         *
         * Note that POST requests will not be sent to the server if this URL is set
         * and matches a cached response.
         */
        fun cacheUrlOverride(cacheUrlOverride: HttpUrl?) =
          apply {
            this.cacheUrlOverride = cacheUrlOverride
          }
    
        /**
         * Configures this request's body to be compressed when it is transmitted. This also adds the
         * 'Content-Encoding: gzip' header.
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Thu Oct 30 13:46:58 UTC 2025
    - 14.7K bytes
    - Viewed (1)
  2. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

      }
    }
    
    private fun Request.requestForCache(): Request {
      val cacheUrlOverride = cacheUrlOverride
    
      // Allow POST and QUERY caching only when there is a cacheUrlOverride
      return if (cacheUrlOverride != null && (HttpMethod.isCacheable(method) || method == "POST")) {
        newBuilder()
          .get()
          .url(cacheUrlOverride)
          .cacheUrlOverride(null)
          .build()
      } else {
        this
      }
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/CacheTest.kt

      fun postWithOverrideResponse() {
        val url = server.url("/abc?token=123")
        val cacheUrlOverride = url.newBuilder().removeAllQueryParameters("token").build()
    
        val request =
          Request
            .Builder()
            .url(url)
            .method("POST", "XYZ".toRequestBody())
            .cacheUrlOverride(cacheUrlOverride)
            .build()
    
        val response = testBasicCachingRules(request)
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Oct 03 17:41:45 UTC 2025
    - 116.8K bytes
    - Viewed (0)
  4. okhttp/api/jvm/okhttp.api

    	public final fun body ()Lokhttp3/RequestBody;
    	public final fun cacheControl ()Lokhttp3/CacheControl;
    	public final fun cacheUrlOverride ()Lokhttp3/HttpUrl;
    	public final fun header (Ljava/lang/String;)Ljava/lang/String;
    	public final fun headers ()Lokhttp3/Headers;
    	public final fun headers (Ljava/lang/String;)Ljava/util/List;
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 70.2K bytes
    - Viewed (0)
  5. CHANGELOG.md

        ```kotlin
        val client = OkHttpClient.Builder()
          .addInterceptor(CompressionInterceptor(Zstd, Gzip))
          .build()
        ```
    
     *  New: Support the `QUERY` HTTP method. You will need to set the `Request.cacheUrlOverride`
        property to cache calls made with this method. The `RequestBody.sha256()` may be helpful here;
        use it to compose a cache URL from the query body.
    
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Dec 05 16:02:59 UTC 2025
    - 36.2K bytes
    - Viewed (2)
  6. okhttp/api/android/okhttp.api

    	public final fun body ()Lokhttp3/RequestBody;
    	public final fun cacheControl ()Lokhttp3/CacheControl;
    	public final fun cacheUrlOverride ()Lokhttp3/HttpUrl;
    	public final fun header (Ljava/lang/String;)Ljava/lang/String;
    	public final fun headers ()Lokhttp3/Headers;
    	public final fun headers (Ljava/lang/String;)Ljava/util/List;
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Wed Nov 05 18:28:35 UTC 2025
    - 70.3K bytes
    - Viewed (0)
Back to top