Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for OkHttpClient (0.21 sec)

  1. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

          )
        }
      }
    
      @Test fun testH2PriorKnowledgeOkHttpClientConstructionSuccess() {
        val okHttpClient =
          OkHttpClient.Builder()
            .protocols(listOf(Protocol.H2_PRIOR_KNOWLEDGE))
            .build()
        assertThat(okHttpClient.protocols.size).isEqualTo(1)
        assertThat(okHttpClient.protocols[0]).isEqualTo(Protocol.H2_PRIOR_KNOWLEDGE)
      }
    
      @Test fun nullDefaultProxySelector() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  2. docs/features/https.md

    By default, OkHttp will attempt a `MODERN_TLS` connection.  However by configuring the client connectionSpecs you can allow a fall back to `COMPATIBLE_TLS` connection if the modern configuration fails.
    
    ```java
    OkHttpClient client = new OkHttpClient.Builder()
        .connectionSpecs(Arrays.asList(ConnectionSpec.MODERN_TLS, ConnectionSpec.COMPATIBLE_TLS))
        .build();
    ```
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Dec 24 00:16:30 GMT 2022
    - 10.5K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

     * exceptions.
     *
     * Use [newClient] as a factory for a OkHttpClient instances. These instances are specifically
     * configured for testing.
     */
    class OkHttpClientTestRule : BeforeEachCallback, AfterEachCallback {
      private val clientEventsList = mutableListOf<String>()
      private var testClient: OkHttpClient? = null
      private var uncaughtException: Throwable? = null
      private lateinit var testName: String
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  4. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        } finally {
          cache.delete()
        }
      }
    
      private fun OkHttpClient.get(url: String) {
        val request = Request.Builder().url(url).build()
        val response = this.newCall(request).execute()
    
        response.use {
          assertEquals(200, response.code)
        }
      }
    
      fun buildCloudflareIp(bootstrapClient: OkHttpClient): DnsOverHttps {
        return DnsOverHttps.Builder().client(bootstrapClient)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 27K bytes
    - Viewed (1)
  5. docs/recipes.md

        ```java
          private final OkHttpClient client = new OkHttpClient();
    
          public void run() throws Exception {
            Request request = new Request.Builder()
                .url("http://httpbin.org/delay/1") // This URL is served with a 1 second delay.
                .build();
    
            // Copy to customize OkHttp for this request.
            OkHttpClient client1 = client.newBuilder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
  6. okhttp/src/main/kotlin/okhttp3/internal/platform/Platform.kt

        message: String,
        stackTrace: Any?,
      ) {
        var logMessage = message
        if (stackTrace == null) {
          logMessage += " To see where this was allocated, set the OkHttpClient logger level to " +
            "FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);"
        }
        log(logMessage, WARN, stackTrace as Throwable?)
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (1)
  7. okhttp/src/test/java/okhttp3/CallHandshakeTest.kt

      private fun expectedConnectionCipherSuites(client: OkHttpClient): Set<String> {
        return client.connectionSpecs.first().cipherSuites!!.map { it.javaName }.intersect(defaultEnabledCipherSuites.toSet())
      }
    
      private fun makeClient(
        connectionSpec: ConnectionSpec? = null,
        tlsVersion: TlsVersion? = null,
        cipherSuites: List<CipherSuite>? = null,
      ): OkHttpClient {
        return this.client.newBuilder()
          .apply {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  8. docs/changelogs/upgrading_to_okhttp_4.md

    
    Backwards-Incompatible Changes
    ------------------------------
    
    #### OkHttpClient final methods
    
    `OkHttpClient` has 26 accessors like `interceptors()` and `writeTimeoutMillis()` that were non-final
    in OkHttp 3.x and are final in 4.x. These were made non-final for use with mocking frameworks like
    [Mockito][mockito]. We believe subtyping `OkHttpClient` is the wrong way to test with OkHttp. If
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 16:58:16 GMT 2022
    - 10.9K bytes
    - Viewed (0)
  9. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/DnsOverHttpsTest.kt

    import java.net.UnknownHostException
    import java.util.concurrent.TimeUnit
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.Cache
    import okhttp3.Dns
    import okhttp3.OkHttpClient
    import okhttp3.Protocol
    import okhttp3.testing.PlatformRule
    import okio.Buffer
    import okio.ByteString.Companion.decodeHex
    import okio.Path.Companion.toPath
    import okio.fakefilesystem.FakeFileSystem
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 11K bytes
    - Viewed (0)
  10. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

    import okio.GzipSource
    
    /**
     * An OkHttp interceptor which logs request and response information. Can be applied as an
     * [application interceptor][OkHttpClient.interceptors] or as a [OkHttpClient.networkInterceptors].
     *
     * The format of the logs created by this class should not be considered stable and may
     * change slightly between releases. If you need a stable logging format, use your own interceptor.
     */
    class HttpLoggingInterceptor
      @JvmOverloads
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
Back to top