- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for addInterceptor (0.14 sec)
-
okhttp/src/commonTest/kotlin/okhttp3/CompressionInterceptorTest.kt
} as Source @Test fun emptyDoesntChangeRequestOrResponse() { val empty = CompressionInterceptor() val client = clientTestRule .newClientBuilder() .addInterceptor(empty) .addInterceptor { chain -> assertThat(chain.request().header("Accept-Encoding")).isNull() Response .Builder() .request(chain.request()) .protocol(Protocol.HTTP_1_1)
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Aug 01 06:04:22 UTC 2025 - 3K bytes - Viewed (0) -
okhttp-brotli/README.md
provided Accept-Encoding is not set previously. Modern web servers must choose to return Brotli responses. n.b. It is not used for sending requests. ```java OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(BrotliInterceptor.INSTANCE) .build(); ``` ```kotlin implementation("com.squareup.okhttp3:okhttp-brotli:5.1.0") ```
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Jul 07 19:32:33 UTC 2025 - 571 bytes - Viewed (0) -
okhttp-zstd/README.md
the `Accept-Encoding` header is not otherwise set. Web servers must be configured to return zstd responses. Note that zstd is not used for sending requests. ```java OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(ZstdInterceptor.INSTANCE) .build(); ``` ```kotlin implementation("com.squareup.okhttp3:okhttp-zstd:0.0.0") ```
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jul 19 13:41:00 UTC 2025 - 556 bytes - Viewed (1) -
samples/guide/src/main/java/okhttp3/recipes/CurrentDateHeader.java
import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public final class CurrentDateHeader { private final OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new CurrentDateInterceptor()) .build(); public void run() throws Exception { Request request = new Request.Builder() .url("https://publicobject.com/helloworld.txt") .build();
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Oct 31 15:32:50 UTC 2018 - 1.8K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PreemptiveAuth.java
import okhttp3.Request; import okhttp3.Response; public final class PreemptiveAuth { private final OkHttpClient client; public PreemptiveAuth() { client = new OkHttpClient.Builder() .addInterceptor( new BasicAuthInterceptor("publicobject.com", "jesse", "password1")) .build(); } public void run() throws Exception { Request request = new Request.Builder()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Nov 05 07:46:46 UTC 2018 - 2.1K bytes - Viewed (0) -
okhttp-brotli/src/test/java/okhttp3/brotli/BrotliTestMain.kt
* limitations under the License. */ package okhttp3.brotli import okhttp3.OkHttpClient import okhttp3.Request fun main() { val client = OkHttpClient .Builder() .addInterceptor(BrotliInterceptor) .build() sendRequest("https://httpbin.org/brotli", client) sendRequest("https://httpbin.org/gzip", client) } private fun sendRequest( url: String, client: OkHttpClient,
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 1.1K bytes - Viewed (1) -
docs/features/interceptors.md
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sun Feb 06 02:19:09 UTC 2022 - 8.1K bytes - Viewed (0) -
okhttp-zstd/src/test/java/okhttp3/zstd/ZstdTestMain.kt
*/ package okhttp3.zstd import okhttp3.CompressionInterceptor import okhttp3.OkHttpClient import okhttp3.Request fun main() { val client = OkHttpClient .Builder() .addInterceptor(CompressionInterceptor(Zstd)) .build() sendRequest("https://developers.facebook.com/docs/", client) sendRequest("https://www.facebook.com/robots.txt", client)
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Tue Jul 29 20:01:04 UTC 2025 - 1.3K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/LoggingInterceptors.java
public final class LoggingInterceptors { private static final Logger logger = Logger.getLogger(LoggingInterceptors.class.getName()); private final OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new LoggingInterceptor()) .build(); public void run() throws Exception { Request request = new Request.Builder() .url("https://publicobject.com/helloworld.txt") .build();
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jan 01 15:55:32 UTC 2016 - 2K bytes - Viewed (0) -
okhttp-logging-interceptor/README.md
```java HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); logging.setLevel(Level.BASIC); OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(logging) .build(); ``` You can change the log level at any time by calling `setLevel()`. To log to a custom location, pass a `Logger` instance to the constructor. ```java
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Jul 07 19:32:33 UTC 2025 - 1.3K bytes - Viewed (0)