Example usage for org.apache.http.impl.client HttpClientBuilder setHttpProcessor

List of usage examples for org.apache.http.impl.client HttpClientBuilder setHttpProcessor

Introduction

In this page you can find the example usage for org.apache.http.impl.client HttpClientBuilder setHttpProcessor.

Prototype

public final HttpClientBuilder setHttpProcessor(final HttpProcessor httpprocessor) 

Source Link

Document

Assigns HttpProcessor instance.

Usage

From source file:com.gargoylesoftware.htmlunit.HttpWebConnection.java

private void configureHttpProcessorBuilder(final HttpClientBuilder builder, final WebRequest webRequest)
        throws IOException {
    final HttpProcessorBuilder b = HttpProcessorBuilder.create();
    for (final HttpRequestInterceptor i : getHttpRequestInterceptors(webRequest)) {
        b.add(i);/*  w w w. j av a 2 s.  c  om*/
    }

    // These are the headers used in HttpClientBuilder, excluding the already added ones
    // (RequestClientConnControl and RequestAddCookies)
    b.addAll(new RequestDefaultHeaders(null), new RequestContent(), new RequestTargetHost(),
            new RequestExpectContinue());
    b.add(new RequestAcceptEncoding());
    b.add(new RequestAuthCache());
    b.add(new ResponseProcessCookies());
    b.add(new ResponseContentEncoding());
    builder.setHttpProcessor(b.build());
}