- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for addNetworkInterceptor (0.27 sec)
-
okhttp/src/jvmTest/kotlin/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 Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jun 21 20:36:35 UTC 2025 - 133.2K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/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 Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 16 09:39:51 UTC 2025 - 113.6K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/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 Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Jul 31 04:18:40 UTC 2025 - 146.6K bytes - Viewed (0)