List of usage examples for org.apache.http.impl.client AbstractHttpClient removeResponseInterceptorByClass
public synchronized void removeResponseInterceptorByClass( final Class<? extends HttpResponseInterceptor> clazz)
From source file:com.jayway.restassured.internal.http.ContentEncodingRegistry.java
/** * Add the request and response interceptors to the {@link HttpClient}, * which will provide transparent decoding of the given content-encoding * types. This method is called by HTTPBuilder and probably should not need * be modified by sub-classes.// ww w . j av a 2 s . com * * @param client client on which to set the request and response interceptors * @param encodings encoding name (either a {@link ContentEncoding.Type} or * a <code>content-encoding</code> string. */ void setInterceptors(final AbstractHttpClient client, Object... encodings) { // remove any encoding interceptors that are already set client.removeRequestInterceptorByClass(ContentEncoding.RequestInterceptor.class); client.removeResponseInterceptorByClass(ContentEncoding.ResponseInterceptor.class); for (Object encName : encodings) { ContentEncoding enc = availableEncoders.get(encName.toString()); if (enc == null) continue; client.addRequestInterceptor(enc.getRequestInterceptor()); client.addResponseInterceptor(enc.getResponseInterceptor()); } }