- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 18 for addNetworkInterceptor (0.11 seconds)
-
okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt
.message("Intercepted!") .body("abc".toResponseBody("text/plain; charset=utf-8".toMediaType())) .build() } client = client .newBuilder() .addNetworkInterceptor(interceptor) .build() val request = Request .Builder() .url(server.url("/")) .build() assertFailsWith<IllegalStateException> {
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Tue Nov 04 16:11:23 GMT 2025 - 28.2K bytes - Click Count (0) -
okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt
fun setUp() { client = OkHttpClient .Builder() .addNetworkInterceptor( Interceptor { chain -> when { extraNetworkInterceptor != null -> extraNetworkInterceptor!!.intercept(chain) else -> chain.proceed(chain.request()) } }, ).addNetworkInterceptor(networkInterceptor) .addInterceptor(applicationInterceptor)
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Fri Nov 07 02:57:33 GMT 2025 - 39.4K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/ConnectionCoalescingTest.kt
server.enqueue(MockResponse()) server.enqueue(MockResponse()) val connection = AtomicReference<Connection?>() client = client .newBuilder() .addNetworkInterceptor( Interceptor { chain: Interceptor.Chain? -> connection.set(chain!!.connection()) chain.proceed(chain.request()) }, ).build()
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Thu Jun 19 11:44:16 GMT 2025 - 19.1K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/CallHandshakeTest.kt
if (cipherSuites != null) { cipherSuites(*cipherSuites.toTypedArray()) } }.build(), ), ) } }.addNetworkInterceptor { val socket = it.connection()!!.socket() as SSLSocket handshakeEnabledCipherSuites = socket.enabledCipherSuites.toList() it.proceed(it.request()) }.build()
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Tue Sep 16 07:21:43 GMT 2025 - 11.4K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/CallKotlinTest.kt
// Capture the connection so that we can later make it stale. var connection: RealConnection? = null client = client .newBuilder() .addNetworkInterceptor( Interceptor { chain -> connection = chain.connection() as RealConnection chain.proceed(chain.request()) }, ).build() server.enqueue(Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Fri Jun 20 11:46:46 GMT 2025 - 8.4K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/FastFallbackTest.kt
} } client = client .newBuilder() .protocols(listOf(Protocol.H2_PRIOR_KNOWLEDGE)) .socketFactory(socketFactory) .addNetworkInterceptor( Interceptor { chain -> try { chain.proceed(chain.request()) } finally { firstConnectLatch.countDown() } },Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Tue Nov 04 19:13:52 GMT 2025 - 10.6K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/OkHttpClientTest.kt
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) } /**
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Jun 18 12:28:21 GMT 2025 - 13.4K bytes - Click Count (1) -
okhttp/src/jvmTest/kotlin/okhttp3/ConnectionReuseTest.kt
// Since this test knowingly leaks a connection, avoid using the default shared connection // pool, which should remain clean for subsequent tests. .connectionPool(ConnectionPool()) .addNetworkInterceptor( Interceptor { chain: Interceptor.Chain? -> val response = chain!!.proceed( chain.request(), ) responsesNotClosed.add(response)Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Fri Jun 20 11:46:46 GMT 2025 - 12.2K bytes - Click Count (1) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/OkHttpClient.kt
fun addNetworkInterceptor(interceptor: Interceptor) = apply { networkInterceptors += interceptor } @JvmName("-addNetworkInterceptor") // Prefix with '-' to prevent ambiguous overloads from Java. inline fun addNetworkInterceptor(crossinline block: (chain: Interceptor.Chain) -> Response) = addNetworkInterceptor(Interceptor { chain -> block(chain) }) /**Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Tue Oct 07 21:55:03 GMT 2025 - 51.4K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt
builder = builder.addInterceptor { it: Interceptor.Chain -> TODO() } val networkInterceptors: List<Interceptor> = builder.networkInterceptors() builder = builder.addNetworkInterceptor(Interceptor { TODO() }) builder = builder.addNetworkInterceptor { it: Interceptor.Chain -> TODO() } builder = builder.eventListener(EventListener.NONE) builder = builder.eventListenerFactory { TODO() }Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 47K bytes - Click Count (0)