Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for networkResponse (0.5 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

        if (cacheResponse != null) {
          if (networkResponse?.code == HTTP_NOT_MODIFIED) {
            val response =
              cacheResponse.newBuilder()
                .headers(combine(cacheResponse.headers, networkResponse.headers))
                .sentRequestAtMillis(networkResponse.sentRequestAtMillis)
                .receivedResponseAtMillis(networkResponse.receivedResponseAtMillis)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Mar 22 07:09:21 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http/BridgeInterceptor.kt

        val networkResponse = chain.proceed(networkRequest)
    
        cookieJar.receiveHeaders(networkRequest.url, networkResponse.headers)
    
        val responseBuilder =
          networkResponse.newBuilder()
            .request(networkRequest)
    
        if (transparentGzip &&
          "gzip".equals(networkResponse.header("Content-Encoding"), ignoreCase = true) &&
          networkResponse.promisesBody()
        ) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/-ResponseCommon.kt

    fun Response.Builder.commonBody(body: ResponseBody) =
      apply {
        this.body = body
      }
    
    fun Response.Builder.commonNetworkResponse(networkResponse: Response?) =
      apply {
        checkSupportResponse("networkResponse", networkResponse)
        this.networkResponse = networkResponse
      }
    
    fun Response.Builder.commonCacheResponse(cacheResponse: Response?) =
      apply {
        checkSupportResponse("cacheResponse", cacheResponse)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:24:48 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/Response.kt

      @JvmName("-deprecated_networkResponse")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "networkResponse"),
        level = DeprecationLevel.ERROR,
      )
      fun networkResponse(): Response? = networkResponse
    
      @JvmName("-deprecated_cacheResponse")
      @Deprecated(
        message = "moved to val",
        replaceWith = ReplaceWith(expression = "cacheResponse"),
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jul 06 09:38:30 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/RecordedResponse.kt

       */
      fun networkResponse(): RecordedResponse {
        val networkResponse = response!!.networkResponse!!
        return RecordedResponse(networkResponse.request, networkResponse, null, null, null)
      }
    
      /** Asserts that the current response didn't use the network.  */
      fun assertNoNetworkResponse() =
        apply {
          assertThat(response!!.networkResponse).isNull()
        }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/kt/CacheResponse.kt

            println("Response 1 response:          $it")
            println("Response 1 cache response:    ${it.cacheResponse}")
            println("Response 1 network response:  ${it.networkResponse}")
            return@use it.body.string()
          }
    
        val response2Body =
          client.newCall(request).execute().use {
            if (!it.isSuccessful) throw IOException("Unexpected code $it")
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/CacheResponse.java

          System.out.println("Response 1 response:          " + response1);
          System.out.println("Response 1 cache response:    " + response1.cacheResponse());
          System.out.println("Response 1 network response:  " + response1.networkResponse());
        }
    
        String response2Body;
        try (Response response2 = client.newCall(request).execute()) {
          if (!response2.isSuccessful()) throw new IOException("Unexpected code " + response2);
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun May 22 01:29:42 UTC 2016
    - 2.4K bytes
    - Viewed (0)
  8. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

        Request request = new Request.Builder()
            .url(url)
            .build();
        try (Response response = client.newCall(request).execute()) {
          String responseSource = response.networkResponse() != null ? ("(network: "
              + response.networkResponse().code()
              + " over "
              + response.protocol()
              + ")") : "(cache)";
          int responseCode = response.code();
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Aug 12 07:26:27 UTC 2021
    - 4.6K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java

          try (Response response = clientForCall.newCall(request).execute()) {
            if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
            System.out.println("    Network: " + (response.networkResponse() != null));
            System.out.println();
          }
        }
      }
    
      public static void main(String... args) throws Exception {
        new RewriteResponseCacheControl(new File("RewriteResponseCacheControl.tmp")).run();
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 12 03:31:36 UTC 2019
    - 2.6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/InterceptorTest.kt

            // The network response also has everything, including the raw gzipped content.
            val networkResponse = chain.proceed(networkRequest)
            assertThat(networkResponse.header("Content-Encoding")).isEqualTo("gzip")
            networkResponse
          }
        client =
          client.newBuilder()
            .addNetworkInterceptor(interceptor)
            .build()
        val request =
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 27.8K bytes
    - Viewed (0)
Back to top