Search in sources :

Example 1 with BridgeInterceptor

use of okhttp3.internal.http.BridgeInterceptor in project okhttp by square.

the class RealCall method getResponseWithInterceptorChain.

Response getResponseWithInterceptorChain() throws IOException {
    // Build a full stack of interceptors.
    List<Interceptor> interceptors = new ArrayList<>();
    interceptors.addAll(client.interceptors());
    interceptors.add(retryAndFollowUpInterceptor);
    interceptors.add(new BridgeInterceptor(client.cookieJar()));
    interceptors.add(new CacheInterceptor(client.internalCache()));
    interceptors.add(new ConnectInterceptor(client));
    if (!forWebSocket) {
        interceptors.addAll(client.networkInterceptors());
    }
    interceptors.add(new CallServerInterceptor(forWebSocket));
    Interceptor.Chain chain = new RealInterceptorChain(interceptors, null, null, null, 0, originalRequest);
    return chain.proceed(originalRequest);
}
Also used : ConnectInterceptor(okhttp3.internal.connection.ConnectInterceptor) RealInterceptorChain(okhttp3.internal.http.RealInterceptorChain) ArrayList(java.util.ArrayList) CallServerInterceptor(okhttp3.internal.http.CallServerInterceptor) BridgeInterceptor(okhttp3.internal.http.BridgeInterceptor) CacheInterceptor(okhttp3.internal.cache.CacheInterceptor) ConnectInterceptor(okhttp3.internal.connection.ConnectInterceptor) RetryAndFollowUpInterceptor(okhttp3.internal.http.RetryAndFollowUpInterceptor) CallServerInterceptor(okhttp3.internal.http.CallServerInterceptor) BridgeInterceptor(okhttp3.internal.http.BridgeInterceptor) CacheInterceptor(okhttp3.internal.cache.CacheInterceptor)

Aggregations

ArrayList (java.util.ArrayList)1 CacheInterceptor (okhttp3.internal.cache.CacheInterceptor)1 ConnectInterceptor (okhttp3.internal.connection.ConnectInterceptor)1 BridgeInterceptor (okhttp3.internal.http.BridgeInterceptor)1 CallServerInterceptor (okhttp3.internal.http.CallServerInterceptor)1 RealInterceptorChain (okhttp3.internal.http.RealInterceptorChain)1 RetryAndFollowUpInterceptor (okhttp3.internal.http.RetryAndFollowUpInterceptor)1