Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for addInterceptor (0.2 sec)

  1. 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)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  2. okhttp-android/src/test/kotlin/okhttp3/android/AndroidLoggingTest.kt

        val interceptor =
          HttpLoggingInterceptor.androidLogging(tag = "testHttpLoggingInterceptor").apply {
            level = HttpLoggingInterceptor.Level.BASIC
          }
    
        val client = clientBuilder.addInterceptor(interceptor).build()
    
        try {
          client.newCall(request).execute()
        } catch (uhe: UnknownHostException) {
          // expected
        }
    
        val logs = ShadowLog.getLogsForTag("testHttpLoggingInterceptor")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 11:07:32 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  3. okhttp/src/test/java/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) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

        fun addInterceptor(interceptor: Interceptor) =
          apply {
            interceptors += interceptor
          }
    
        @JvmName("-addInterceptor") // Prefix with '-' to prevent ambiguous overloads from Java.
        inline fun addInterceptor(crossinline block: (chain: Interceptor.Chain) -> Response) =
          addInterceptor(Interceptor { chain -> block(chain) })
    
        /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
  5. okhttp/src/test/java/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)
      }
    
      /**
    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)
  6. okhttp/src/test/java/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.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 35.2K bytes
    - Viewed (1)
  7. okhttp/src/test/java/okhttp3/CallTest.kt

      @Test
      fun interceptorRecoversWhenRoutesExhausted() {
        server.enqueue(MockResponse(socketPolicy = DisconnectAtStart))
        server.enqueue(MockResponse())
        client =
          client.newBuilder()
            .addInterceptor(
              Interceptor { chain: Interceptor.Chain ->
                try {
                  chain.proceed(chain.request())
                  throw AssertionError()
                } catch (expected: IOException) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  8. okhttp/src/test/java/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() })
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  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).
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  10. okhttp/api/okhttp.api

    }
    
    public final class okhttp3/OkHttpClient$Builder {
    	public final fun -addInterceptor (Lkotlin/jvm/functions/Function1;)Lokhttp3/OkHttpClient$Builder;
    	public final fun -addNetworkInterceptor (Lkotlin/jvm/functions/Function1;)Lokhttp3/OkHttpClient$Builder;
    	public fun <init> ()V
    	public final fun addInterceptor (Lokhttp3/Interceptor;)Lokhttp3/OkHttpClient$Builder;
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:41:01 GMT 2024
    - 70.2K bytes
    - Viewed (0)
Back to top