Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 265 for responses (0.18 sec)

  1. mockwebserver/README.md

    from your test's `tearDown()`.
    
    ### API
    
    #### MockResponse
    
    Mock responses default to an empty response body and a `200` status code.
    You can set a custom body with a string, input stream or byte array. Also
    add headers with a fluent builder API.
    
    ```java
    MockResponse response = new MockResponse()
        .addHeader("Content-Type", "application/json; charset=utf-8")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  2. okhttp/src/main/kotlin/okhttp3/Interceptor.kt

     * responses coming back in. Typically interceptors add, remove, or transform headers on the request
     * or response.
     *
     * Implementations of this interface throw [IOException] to signal connectivity failures. This
     * includes both natural exceptions such as unreachable servers, as well as synthetic exceptions
     * when responses are of an unexpected type or cannot be decoded.
     *
    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)
  3. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/HpackRoundTripTest.kt

     *
     * TODO: update hpack-test-case with the output of our encoder.
     * This test will hide complementary bugs in the encoder and decoder,
     * We should test that the encoder is producing responses that are
     */
    class HpackRoundTripTest : HpackDecodeTestBase() {
      internal class StoriesTestProvider : SimpleProvider() {
        override fun arguments(): List<Any> = createStories(RAW_DATA)
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2K bytes
    - Viewed (0)
  4. docs/changelogs/changelog_4x.md

        proxy selection process.
     *  New: `Response.byteString()` reads the entire response into memory as a byte string.
     *  New: `OkHttpClient.x509TrustManager` accessor.
     *  New: Permit [new WebSocket response codes][iana_websocket]: 1012 (Service Restart), 1013 (Try
        Again Later), and 1014 (invalid response from the upstream).
     *  New: Build with Kotlin 1.3.41, BouncyCastle 1.62, and Conscrypt 2.2.1.
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  5. docs/features/events.md

    System.out.println("REQUEST 1 (new connection)");
    try (Response response = client.newCall(request).execute()) {
      // Consume and discard the response body.
      response.body().source().readByteString();
    }
    
    System.out.println("REQUEST 2 (pooled connection)");
    try (Response response = client.newCall(request).execute()) {
      // Consume and discard the response body.
      response.body().source().readByteString();
    }
    ```
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 7.7K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. okhttp-testing-support/src/main/kotlin/okhttp3/internal/RecordingOkAuthenticator.kt

        route: Route?,
        response: Response,
      ): Request? {
        if (route == null) throw NullPointerException("route == null")
        responses += response
        routes += route
        if (!schemeMatches(response) || credential == null) return null
        val header =
          when (response.code) {
            407 -> "Proxy-Authorization"
            else -> "Authorization"
          }
        return response.request.newBuilder()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  9. mockwebserver/src/main/kotlin/mockwebserver3/Dispatcher.kt

       * can return other values to test HTTP edge cases, such as unhappy socket policies or throttled
       * request bodies.
       */
      open fun peek(): MockResponse {
        return MockResponse(socketPolicy = KeepOpen)
      }
    
      /**
       * Release any resources held by this dispatcher. Any requests that are currently being dispatched
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java

          } else {
            System.out.println("Force cache: false");
            clientForCall = client;
          }
    
          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();
          }
        }
      }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.6K bytes
    - Viewed (0)
Back to top