Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for addInterceptor (0.16 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt

            chain.proceed(chain.request())
          }
        client =
          client
            .newBuilder()
            .connectTimeout(Duration.ofSeconds(5))
            .addInterceptor(interceptor1)
            .addInterceptor(interceptor2)
            .build()
        val request1 =
          Request
            .Builder()
            .url("http://" + TestUtil.UNREACHABLE_ADDRESS_IPV4)
            .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)
  2. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

                  else -> chain.proceed(chain.request())
                }
              },
            ).addNetworkInterceptor(networkInterceptor)
            .addInterceptor(applicationInterceptor)
            .sslSocketFactory(
              handshakeCertificates.sslSocketFactory(),
              handshakeCertificates.trustManager,
            ).hostnameVerifier(hostnameVerifier)
            .build()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Aug 21 14:27:04 UTC 2025
    - 37.5K bytes
    - Viewed (0)
  3. okhttp/src/jvmTest/kotlin/okhttp3/DispatcherTest.kt

      }
    
      @Test
      fun synchronousCallAccessors() {
        val ready = CountDownLatch(2)
        val waiting = CountDownLatch(1)
        client =
          client
            .newBuilder()
            .addInterceptor(
              Interceptor { chain: Interceptor.Chain? ->
                try {
                  ready.countDown()
                  waiting.await()
                } catch (e: InterruptedException) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/OkHttpClientTest.kt

        val interceptor =
          Interceptor { chain: Interceptor.Chain ->
            chain.proceed(chain.request())
          }
        val original = clientTestRule.newClient()
        original
          .newBuilder()
          .addInterceptor(interceptor)
          .addNetworkInterceptor(interceptor)
          .build()
        assertThat(original.interceptors.size).isEqualTo(0)
        assertThat(original.networkInterceptors.size).isEqualTo(0)
      }
    
      /**
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 13.4K bytes
    - Viewed (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketHttpTest.kt

      private val random = Random(0)
      private var client =
        clientTestRule
          .newClientBuilder()
          .writeTimeout(Duration.ofMillis(500))
          .readTimeout(Duration.ofMillis(500))
          .addInterceptor(
            Interceptor { chain: Interceptor.Chain ->
              val response = chain.proceed(chain.request())
              // Ensure application interceptors never see a null body.
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Jun 20 11:46:46 UTC 2025
    - 35.5K bytes
    - Viewed (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/DuplexTest.kt

            .Builder()
            .clearHeaders()
            .socketHandler(body)
            .build(),
        )
        client =
          client
            .newBuilder()
            .addInterceptor(UppercaseRequestInterceptor())
            .addInterceptor(UppercaseResponseInterceptor())
            .build()
        val call =
          client.newCall(
            Request
              .Builder()
              .url(server.url("/"))
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 24.8K bytes
    - Viewed (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

        builder = builder.connectionSpecs(listOf(ConnectionSpec.MODERN_TLS))
        val interceptors: List<Interceptor> = builder.interceptors()
        builder = builder.addInterceptor(Interceptor { TODO() })
        builder = builder.addInterceptor { it: Interceptor.Chain -> TODO() }
        val networkInterceptors: List<Interceptor> = builder.networkInterceptors()
        builder = builder.addNetworkInterceptor(Interceptor { TODO() })
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Jun 21 20:36:35 UTC 2025
    - 46.5K bytes
    - Viewed (0)
  8. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        OkHttpClientTestRule().apply {
          logger = Logger.getLogger(OkHttpTest::class.java.name)
        }
    
      private var client: OkHttpClient =
        clientTestRule
          .newClientBuilder()
          .addInterceptor(CompressionInterceptor(Zstd, Brotli, Gzip))
          .build()
    
      private val moshi =
        Moshi
          .Builder()
          .add(KotlinJsonAdapterFactory())
          .build()
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 02 14:12:28 UTC 2025
    - 29K bytes
    - Viewed (0)
  9. docs/changelogs/changelog_4x.md

        enable [Brotli compression][brotli], which compresses 5-20% smaller than gzip.
    
        ```
        val client = OkHttpClient.Builder()
            .addInterceptor(BrotliInterceptor)
            .build()
        ```
    
        This artifact has a dependency on Google's Brotli decoder (95 KiB).
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Apr 17 13:25:31 UTC 2024
    - 25.2K bytes
    - Viewed (0)
Back to top