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

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

Introduction

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

Prototype

public final HttpClientBuilder disableAuthCaching() 

Source Link

Document

Disables authentication scheme caching.

Usage

From source file:com.kolich.http.HttpClient4ClosureBuilder.java

public HttpClientBuilder getHttpClientBuilder() {
    final HttpClientBuilder builder = HttpClients.custom().setDefaultRequestConfig(getRequestConfig())
            .setConnectionManager(getConnectionManager()).setUserAgent(userAgent_);
    // See http://stackoverflow.com/questions/21818242/with-httpclient-4-3-x-executing-a-httphead-for-a-specific-url-gives-nohttprespo
    // Also, see https://issues.apache.org/jira/browse/HTTPCLIENT-1464
    // This disables the addition of the `Accept-Encoding: gzip,deflate`
    // header on outgoing requests which seems to confuse some servers.
    // This is off by default, but can be turned off if desired.
    if (disableContentCompression_) {
        builder.disableContentCompression();
    }/* w w  w  .ja  v  a  2 s .c o  m*/
    if (disableAutomaticRetries_) {
        builder.disableAutomaticRetries();
    }
    if (disableAuthCaching_) {
        builder.disableAuthCaching();
    }
    if (useProxySelector_) {
        builder.setRoutePlanner(new SystemDefaultRoutePlanner(ProxySelector.getDefault()));
    }
    return builder;
}