Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 263 for response (0.18 sec)

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

        }
    
        internal constructor(response: Response) {
          this.request = response.request
          this.protocol = response.protocol
          this.code = response.code
          this.message = response.message
          this.handshake = response.handshake
          this.headers = response.headers.newBuilder()
          this.body = response.body
          this.networkResponse = response.networkResponse
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 15.5K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

          val code = response.code
          if (code != HTTP_TEMP_REDIRECT && code != HTTP_PERM_REDIRECT) return response
          val method = response.request.method
          if (method == "GET" || method == "HEAD") return response
          val location = response.header("Location") ?: return response
          return response.newBuilder()
            .removeHeader("Location")
            .header("LegacyRedirectInterceptor-Location", location)
            .build()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Callback.kt

      )
    
      /**
       * Called when the HTTP response was successfully returned by the remote server. The callback may
       * proceed to read the response body with [Response.body]. The response is still live until its
       * response body is [closed][ResponseBody]. The recipient of the callback may consume the response
       * body on another thread.
       *
       * Note that transport-layer success (receiving a HTTP response code, headers and body) does not
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

            writeTimeoutMillis = client.writeTimeoutMillis,
          )
    
        var calledNoMoreExchanges = false
        try {
          val response = chain.proceed(originalRequest)
          if (isCanceled()) {
            response.closeQuietly()
            throw IOException("Canceled")
          }
          return response
        } catch (e: IOException) {
          calledNoMoreExchanges = true
          throw noMoreExchanges(e) as Throwable
        } finally {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  5. okhttp/src/main/kotlin/okhttp3/Interceptor.kt

     *    libraries may customize this behavior.)
     *
     * A good way to signal a failure is with a synthetic HTTP response:
     *
     * ```kotlin
     *   @Throws(IOException::class)
     *   override fun intercept(chain: Interceptor.Chain): Response {
     *     if (myConfig.isInvalid()) {
     *       return Response.Builder()
     *           .request(chain.request())
     *           .protocol(Protocol.HTTP_1_1)
     *           .code(400)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  6. okhttp-coroutines/src/main/kotlin/okhttp3/JvmCallExtensions.kt

              e: IOException,
            ) {
              continuation.resumeWithException(e)
            }
    
            override fun onResponse(
              call: Call,
              response: Response,
            ) {
              continuation.resume(response) {
                response.closeQuietly()
              }
            }
          },
        )
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Fri Apr 05 11:25:23 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/Authenticate.kt

    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.Route
    
    class Authenticate {
      private val client =
        OkHttpClient.Builder()
          .authenticator(
            object : Authenticator {
              @Throws(IOException::class)
              override fun authenticate(
                route: Route?,
                response: Response,
              ): Request? {
                if (response.request.header("Authorization") != null) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Authenticator.kt

     * to limit the retries by the class of errors and number of attempts.  To get the number of
     * attempts to the current point use this function.
     *
     * ```java
     * private int responseCount(Response response) {
     *   int result = 1;
     *   while ((response = response.priorResponse()) != null) {
     *     result++;
     *   }
     *   return result;
     * }
     * ```
     *
     * [1]: https://tools.ietf.org/html/rfc2817
     */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  9. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

            buildString {
              append("<-- ${response.code}")
              if (response.message.isNotEmpty()) append(" ${response.message}")
              append(" ${redactUrl(response.request.url)} (${tookMs}ms")
              if (!logHeaders) append(", $bodySize body")
              append(")")
            },
          )
    
          if (logHeaders) {
            val headers = response.headers
            for (i in 0 until headers.size) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  10. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

        val call1 = localClient.newCall(Request(server.url("/")))
    
        call1.execute().use { response ->
          assertThat(response.body.string()).isEqualTo("Req1")
          assertThat(response.handshake).isNotNull()
          assertThat(response.protocol == Protocol.HTTP_1_1)
        }
    
        eventListener.closed = true
    
        val call2 = localClient.newCall(Request(server.url("/")))
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top