Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for networkResponse (0.07 sec)

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

          }
    
        open fun socket(socket: Socket) =
          apply {
            this.socket = socket
          }
    
        open fun networkResponse(networkResponse: Response?) =
          apply {
            checkSupportResponse("networkResponse", networkResponse)
            this.networkResponse = networkResponse
          }
    
        open fun cacheResponse(cacheResponse: Response?) =
          apply {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 14:39:28 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  2. okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt

        delegate.retryDecision(call, exception, retry)
      }
    
      override fun followUpDecision(
        call: Call,
        networkResponse: Response,
        nextRequest: Request?,
      ) {
        logWithTime("followUpDecision")
    
        delegate.followUpDecision(call, networkResponse, nextRequest)
      }
    
      private fun logWithTime(message: String) {
        val startNs = startNs
        val timeMs =
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:58:02 UTC 2025
    - 6.5K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/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()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 28.2K bytes
    - Viewed (0)
  4. okhttp-zstd/src/test/java/okhttp3/zstd/ZstdTestMain.kt

    private fun sendRequest(
      url: String,
      client: OkHttpClient,
    ) {
      val req = Request.Builder().url(url).build()
    
      client.newCall(req).execute().use {
        println(url)
        println("""Content-Encoding: ${it.networkResponse?.header("Content-Encoding")}""")
        println("| ${it.body.string().replace("\n", "\n| ")}")
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 20:01:04 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  5. 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 Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jul 23 00:58:06 UTC 2025
    - 5K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingEventListener.kt

        retry: Boolean,
      ) = logEvent(RetryDecision(System.nanoTime(), call, exception, retry))
    
      override fun followUpDecision(
        call: Call,
        networkResponse: Response,
        nextRequest: Request?,
      ) = logEvent(FollowUpDecision(System.nanoTime(), call, networkResponse, nextRequest))
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:58:02 UTC 2025
    - 9.5K bytes
    - Viewed (0)
  7. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/UnreadableResponseBody.kt

        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.)
          """.trimMargin(),
        )
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 15:19:53 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

        val body: ResponseBody = response.body
        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()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 46.5K bytes
    - Viewed (0)
  9. okhttp/src/commonJvmAndroid/kotlin/okhttp3/EventListener.kt

       *  * [OkHttpClient.authenticator] must respond to an authorization challenge.
       *
       * @param networkResponse the intermediate response that may require a follow-up request.
       * @param nextRequest the follow-up request that will be made. Null if no follow-up will be made.
       */
      open fun followUpDecision(
        call: Call,
        networkResponse: Response,
        nextRequest: Request?,
      ) {
      }
    
      fun interface Factory {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue May 27 14:58:02 UTC 2025
    - 17.4K bytes
    - Viewed (0)
  10. docs/recipes.md

              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 Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 17:01:12 UTC 2025
    - 47.8K bytes
    - Viewed (0)
Back to top