Search in sources :

Example 6 with HttpResponseInterceptor

use of org.apache.http.HttpResponseInterceptor in project camel by apache.

the class HttpCompressionTest method getBasicHttpProcessor.

@Override
protected HttpProcessor getBasicHttpProcessor() {
    List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
    requestInterceptors.add(new RequestDecompressingInterceptor());
    List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
    responseInterceptors.add(new ResponseCompressingInterceptor());
    responseInterceptors.add(new ResponseBasicUnauthorized());
    ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
    return httpproc;
}
Also used : HttpRequestInterceptor(org.apache.http.HttpRequestInterceptor) ResponseBasicUnauthorized(org.apache.http.localserver.ResponseBasicUnauthorized) ArrayList(java.util.ArrayList) HttpResponseInterceptor(org.apache.http.HttpResponseInterceptor) ImmutableHttpProcessor(org.apache.http.protocol.ImmutableHttpProcessor)

Example 7 with HttpResponseInterceptor

use of org.apache.http.HttpResponseInterceptor in project camel by apache.

the class HttpAuthenticationTest method getBasicHttpProcessor.

@Override
protected HttpProcessor getBasicHttpProcessor() {
    List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
    requestInterceptors.add(new RequestBasicAuth());
    List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
    responseInterceptors.add(new ResponseContent());
    responseInterceptors.add(new ResponseBasicUnauthorized());
    ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
    return httpproc;
}
Also used : ResponseContent(org.apache.http.protocol.ResponseContent) HttpRequestInterceptor(org.apache.http.HttpRequestInterceptor) ResponseBasicUnauthorized(org.apache.http.localserver.ResponseBasicUnauthorized) ArrayList(java.util.ArrayList) HttpResponseInterceptor(org.apache.http.HttpResponseInterceptor) RequestBasicAuth(org.apache.http.localserver.RequestBasicAuth) ImmutableHttpProcessor(org.apache.http.protocol.ImmutableHttpProcessor)

Example 8 with HttpResponseInterceptor

use of org.apache.http.HttpResponseInterceptor in project XobotOS by xamarin.

the class BasicHttpProcessor method process.

// non-Javadoc, see interface HttpResponseInterceptor (via HttpProcessor)
public void process(final HttpResponse response, final HttpContext context) throws IOException, HttpException {
    if (this.responseInterceptors != null) {
        for (int i = 0; i < this.responseInterceptors.size(); i++) {
            HttpResponseInterceptor interceptor = (HttpResponseInterceptor) this.responseInterceptors.get(i);
            interceptor.process(response, context);
        }
    }
}
Also used : HttpResponseInterceptor(org.apache.http.HttpResponseInterceptor)

Example 9 with HttpResponseInterceptor

use of org.apache.http.HttpResponseInterceptor in project camel by apache.

the class HttpProxyServerTest method getBasicHttpProcessor.

@Override
protected HttpProcessor getBasicHttpProcessor() {
    List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
    requestInterceptors.add(new RequestProxyBasicAuth());
    List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
    responseInterceptors.add(new ResponseContent());
    responseInterceptors.add(new ResponseProxyBasicUnauthorized());
    ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
    return httpproc;
}
Also used : ResponseContent(org.apache.http.protocol.ResponseContent) HttpRequestInterceptor(org.apache.http.HttpRequestInterceptor) ArrayList(java.util.ArrayList) HttpResponseInterceptor(org.apache.http.HttpResponseInterceptor) ImmutableHttpProcessor(org.apache.http.protocol.ImmutableHttpProcessor)

Example 10 with HttpResponseInterceptor

use of org.apache.http.HttpResponseInterceptor in project camel by apache.

the class HttpsAuthenticationTest method getBasicHttpProcessor.

@Override
protected HttpProcessor getBasicHttpProcessor() {
    List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
    requestInterceptors.add(new RequestBasicAuth());
    List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
    responseInterceptors.add(new ResponseContent());
    responseInterceptors.add(new ResponseBasicUnauthorized());
    ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
    return httpproc;
}
Also used : ResponseContent(org.apache.http.protocol.ResponseContent) HttpRequestInterceptor(org.apache.http.HttpRequestInterceptor) ResponseBasicUnauthorized(org.apache.http.localserver.ResponseBasicUnauthorized) ArrayList(java.util.ArrayList) HttpResponseInterceptor(org.apache.http.HttpResponseInterceptor) RequestBasicAuth(org.apache.http.localserver.RequestBasicAuth) ImmutableHttpProcessor(org.apache.http.protocol.ImmutableHttpProcessor)

Aggregations

HttpResponseInterceptor (org.apache.http.HttpResponseInterceptor)11 HttpRequestInterceptor (org.apache.http.HttpRequestInterceptor)6 ArrayList (java.util.ArrayList)4 ImmutableHttpProcessor (org.apache.http.protocol.ImmutableHttpProcessor)4 ResponseBasicUnauthorized (org.apache.http.localserver.ResponseBasicUnauthorized)3 ResponseContent (org.apache.http.protocol.ResponseContent)3 IOException (java.io.IOException)2 Header (org.apache.http.Header)2 HttpEntity (org.apache.http.HttpEntity)2 HttpResponse (org.apache.http.HttpResponse)2 RequestBasicAuth (org.apache.http.localserver.RequestBasicAuth)2 HttpContext (org.apache.http.protocol.HttpContext)2 TestHttpClient (io.undertow.testutils.TestHttpClient)1 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 SSLContext (javax.net.ssl.SSLContext)1 HttpException (org.apache.http.HttpException)1 RequestConfig (org.apache.http.client.config.RequestConfig)1