Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for addNetworkInterceptor (0.43 sec)

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

        val url = server.url("/")
        assertThat(get(url).body.string()).isEqualTo("A")
        val ifNoneMatch = AtomicReference<String?>()
        client =
          client.newBuilder()
            .addNetworkInterceptor(
              Interceptor { chain: Interceptor.Chain ->
                ifNoneMatch.compareAndSet(null, chain.request().header("If-None-Match"))
                chain.proceed(chain.request())
              },
            )
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 108.6K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

       * as a **network interceptor**. It will strip the `Location` header of impacted responses to
       * prevent the redirect.
       *
       * ```
       * OkHttpClient client = client.newBuilder()
       *   .addNetworkInterceptor(new LegacyRedirectInterceptor())
       *   .build();
       * ```
       */
      internal class LegacyRedirectInterceptor : Interceptor {
        override fun intercept(chain: Interceptor.Chain): Response {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 131.7K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/CallTest.kt

      }
    
      @Test
      fun cancelImmediatelyAfterEnqueue() {
        server.enqueue(MockResponse())
        val latch = CountDownLatch(1)
        client =
          client.newBuilder()
            .addNetworkInterceptor(
              Interceptor { chain: Interceptor.Chain ->
                try {
                  latch.await()
                } catch (e: InterruptedException) {
                  throw AssertionError(e)
                }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 142.5K bytes
    - Viewed (0)
Back to top