Example usage for com.squareup.okhttp Interceptor interface-usage

List of usage examples for com.squareup.okhttp Interceptor interface-usage

Introduction

In this page you can find the example usage for com.squareup.okhttp Interceptor interface-usage.

Usage

From source file com.citrus.retrofit.ReceivedCookiesInterceptor.java

/**
 * Created by MANGESH KADAM on 5/15/2015.
 */
public class ReceivedCookiesInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {

From source file com.cml.rx.android.api.HttpLoggingInterceptor.java

/**
 * An OkHttp interceptor which logs request and response information. Can be
 * applied as an {@linkplain OkHttpClient#interceptors() application
 * interceptor} or as a {@linkplain OkHttpClient#networkInterceptors() network
 * interceptor}.
 * <p>

From source file com.codenote.tikal.example.client.HttpLoggingInterceptor.java

/**
 * An OkHttp interceptor which logs request and response information. Can be applied as an
 * {@linkplain OkHttpClient#interceptors() application interceptor} or as a
 * {@linkplain OkHttpClient#networkInterceptors() network interceptor}.
 * <p/>
 * The format of the logs created by this class should not be considered stable and may change

From source file com.example.data.net.interceptor.CacheResponseInterceptor.java

/**
 * Author: Victor Hidalgo
 * Date: 06.05.15.
 * Desc : Interceptor to rewrite cache header with necessary parameters for caching with okhttp
 */
public class CacheResponseInterceptor implements Interceptor {

From source file com.example.data.net.interceptor.UserAgentInterceptor.java

/**
 * Replaces default user agent by a custom one provided with dagger
 */
public class UserAgentInterceptor implements Interceptor {
    private static final String USER_AGENT_HEADER_NAME = "User-Agent";
    private final String userAgentHeaderValue;

From source file com.facebook.stetho.okhttp.StethoInterceptor.java

/**
 * Provides easy integration with <a href="http://square.github.io/okhttp/">OkHttp</a> 2.2.0+
 * by way of the new <a href="https://github.com/square/okhttp/wiki/Interceptors">Interceptor</a>
 * system. To use:
 * <pre>
 *   OkHttpClient client = new OkHttpClient();

From source file com.heroiclabs.sdk.android.util.http.GzipRequestInterceptor.java

/**
 * An OkHttp interceptor that compresses request bodies.
 * See https://github.com/square/okhttp/issues/350
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class GzipRequestInterceptor implements Interceptor {

From source file com.heroiclabs.sdk.android.util.http.RetryInterceptor.java

/**
 * An OkHttp interceptor that retries calls in case of network failures.
 */
@RequiredArgsConstructor(suppressConstructorProperties = true)
public class RetryInterceptor implements Interceptor {

From source file com.ibm.mobilefirstplatform.clientsdk.android.analytics.internal.MetadataHeaderInterceptor.java

public class MetadataHeaderInterceptor implements Interceptor {
    public static final String ANALYTICS_DEVICE_METADATA_HEADER_NAME = "x-mfp-analytics-metadata";
    protected final JSONObject analyticsMetadataHeaderObject;

    public MetadataHeaderInterceptor(Context appContext) {
        super();

From source file com.ibm.mobilefirstplatform.clientsdk.android.analytics.internal.NetworkLoggingInterceptor.java

public class NetworkLoggingInterceptor implements Interceptor {
    @Override
    public com.squareup.okhttp.Response intercept(Interceptor.Chain chain) throws IOException {
        Request request = chain.request();

        long startTime = System.currentTimeMillis();