Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 79 for intercept (0.21 sec)

  1. okhttp/src/main/kotlin/okhttp3/Interceptor.kt

     *   }
     * ```
     */
    fun interface Interceptor {
      @Throws(IOException::class)
      fun intercept(chain: Chain): Response
    
      companion object {
        /**
         * Constructs an interceptor for a lambda. This compact syntax is most useful for inline
         * interceptors.
         *
         * ```kotlin
         * val interceptor = Interceptor { chain: Interceptor.Chain ->
         *     chain.proceed(chain.request())
         * }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/connection/ConnectInterceptor.kt

    import java.io.IOException
    import okhttp3.Interceptor
    import okhttp3.Response
    import okhttp3.internal.http.RealInterceptorChain
    
    /**
     * Opens a connection to the target server and proceeds to the next interceptor. The network might
     * be used for the returned response, or to validate a cached response with a conditional GET.
     */
    object ConnectInterceptor : Interceptor {
      @Throws(IOException::class)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/UppercaseResponseInterceptor.kt

     */
    package okhttp3
    
    import java.io.IOException
    import okhttp3.Interceptor.Chain
    import okio.Buffer
    import okio.BufferedSource
    import okio.ForwardingSource
    import okio.buffer
    
    /** Rewrites the response body returned from the server to be all uppercase.  */
    class UppercaseResponseInterceptor : Interceptor {
      @Throws(IOException::class)
      override fun intercept(chain: Chain): Response {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  4. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

     *
     * The format of the logs created by this class should not be considered stable and may
     * change slightly between releases. If you need a stable logging format, use your own interceptor.
     */
    class HttpLoggingInterceptor
      @JvmOverloads
      constructor(
        private val logger: Logger = Logger.DEFAULT,
      ) : Interceptor {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  5. docs/features/interceptors.md

    ```java
    /** Dangerous interceptor that rewrites the server's cache-control header. */
    private static final Interceptor REWRITE_CACHE_CONTROL_INTERCEPTOR = new Interceptor() {
      @Override public Response intercept(Interceptor.Chain chain) throws IOException {
        Response originalResponse = chain.proceed(chain.request());
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 8.1K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/UppercaseRequestInterceptor.kt

    package okhttp3
    
    import java.io.IOException
    import okhttp3.Interceptor.Chain
    import okio.Buffer
    import okio.BufferedSink
    import okio.ForwardingSink
    import okio.Sink
    import okio.buffer
    
    /** Rewrites the request body sent to the server to be all uppercase.  */
    class UppercaseRequestInterceptor : Interceptor {
      @Throws(IOException::class)
      override fun intercept(chain: Chain): Response {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/LoggingInterceptors.java

            .build();
    
        Response response = client.newCall(request).execute();
        response.body().close();
      }
    
      private static class LoggingInterceptor implements Interceptor {
        @Override public Response intercept(Chain chain) throws IOException {
          long t1 = System.nanoTime();
          Request request = chain.request();
          logger.info(String.format("Sending request %s on %s%n%s",
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jan 01 15:55:32 GMT 2016
    - 2K bytes
    - Viewed (0)
  8. okhttp-brotli/api/okhttp-brotli.api

    public final class okhttp3/brotli/BrotliInterceptor : okhttp3/Interceptor {
    	public static final field INSTANCE Lokhttp3/brotli/BrotliInterceptor;
    	public fun intercept (Lokhttp3/Interceptor$Chain;)Lokhttp3/Response;
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Feb 26 19:17:33 GMT 2022
    - 220 bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PreemptiveAuth.java

      }
    
      static final class BasicAuthInterceptor implements Interceptor {
        private final String credentials;
        private final String host;
    
        BasicAuthInterceptor(String host, String username, String password) {
          this.credentials = Credentials.basic(username, password);
          this.host = host;
        }
    
        @Override public Response intercept(Chain chain) throws IOException {
          Request request = chain.request();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Nov 05 07:46:46 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/http/RealInterceptorChain.kt

        val response =
          interceptor.intercept(next) ?: throw NullPointerException(
            "interceptor $interceptor returned null",
          )
    
        if (exchange != null) {
          check(index + 1 >= interceptors.size || next.calls == 1) {
            "network interceptor $interceptor must call proceed() exactly once"
          }
        }
    
        return response
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
Back to top