Class RequestConfig
- All Implemented Interfaces:
Cloneable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanprivate final intprivate final intprivate final booleanprivate final Stringstatic final RequestConfigprivate final booleanprivate final InetAddressprivate final intprivate final booleanprivate final org.apache.http.HttpHostprivate final Collection<String> private final booleanprivate final booleanprivate final intprivate final booleanprivate final Collection<String> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIntended for CDI compatibility(package private)RequestConfig(boolean expectContinueEnabled, org.apache.http.HttpHost proxy, InetAddress localAddress, boolean staleConnectionCheckEnabled, String cookieSpec, boolean redirectsEnabled, boolean relativeRedirectsAllowed, boolean circularRedirectsAllowed, int maxRedirects, boolean authenticationEnabled, Collection<String> targetPreferredAuthSchemes, Collection<String> proxyPreferredAuthSchemes, int connectionRequestTimeout, int connectTimeout, int socketTimeout, boolean contentCompressionEnabled, boolean normalizeUri) -
Method Summary
Modifier and TypeMethodDescriptionprotected RequestConfigclone()static RequestConfig.Buildercopy(RequestConfig config) static RequestConfig.Buildercustom()intReturns the timeout in milliseconds used when requesting a connection from the connection manager.intDetermines the timeout in milliseconds until a connection is established.Determines the name of the cookie specification to be used for HTTP state management.Returns local address to be used for request execution.intReturns the maximum number of redirects to be followed.org.apache.http.HttpHostgetProxy()Returns HTTP proxy to be used for request execution.Determines the order of preference for supported authentication schemes when authenticating with the proxy host.intDefines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets).Determines the order of preference for supported authentication schemes when authenticating with the target host.booleanDetermines whether authentication should be handled automatically.booleanDetermines whether circular redirects (redirects to the same location) should be allowed.booleanDetermines whether the target server is requested to compress content.booleanDeprecated.booleanDetermines whether the 'Expect: 100-Continue' handshake is enabled for entity enclosing methods.booleanDetermines whether client should normalize URIs in requests or not.booleanDetermines whether redirects should be handled automatically.booleanDetermines whether relative redirects should be rejected.booleanDeprecated.toString()
-
Field Details
-
DEFAULT
-
expectContinueEnabled
private final boolean expectContinueEnabled -
proxy
private final org.apache.http.HttpHost proxy -
localAddress
-
staleConnectionCheckEnabled
private final boolean staleConnectionCheckEnabled -
cookieSpec
-
redirectsEnabled
private final boolean redirectsEnabled -
relativeRedirectsAllowed
private final boolean relativeRedirectsAllowed -
circularRedirectsAllowed
private final boolean circularRedirectsAllowed -
maxRedirects
private final int maxRedirects -
authenticationEnabled
private final boolean authenticationEnabled -
targetPreferredAuthSchemes
-
proxyPreferredAuthSchemes
-
connectionRequestTimeout
private final int connectionRequestTimeout -
connectTimeout
private final int connectTimeout -
socketTimeout
private final int socketTimeout -
contentCompressionEnabled
private final boolean contentCompressionEnabled -
normalizeUri
private final boolean normalizeUri
-
-
Constructor Details
-
RequestConfig
protected RequestConfig()Intended for CDI compatibility -
RequestConfig
RequestConfig(boolean expectContinueEnabled, org.apache.http.HttpHost proxy, InetAddress localAddress, boolean staleConnectionCheckEnabled, String cookieSpec, boolean redirectsEnabled, boolean relativeRedirectsAllowed, boolean circularRedirectsAllowed, int maxRedirects, boolean authenticationEnabled, Collection<String> targetPreferredAuthSchemes, Collection<String> proxyPreferredAuthSchemes, int connectionRequestTimeout, int connectTimeout, int socketTimeout, boolean contentCompressionEnabled, boolean normalizeUri)
-
-
Method Details
-
isExpectContinueEnabled
public boolean isExpectContinueEnabled()Determines whether the 'Expect: 100-Continue' handshake is enabled for entity enclosing methods. The purpose of the 'Expect: 100-Continue' handshake is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body.The use of the 'Expect: 100-continue' handshake can result in a noticeable performance improvement for entity enclosing requests (such as POST and PUT) that require the target server's authentication.
'Expect: 100-continue' handshake should be used with caution, as it may cause problems with HTTP servers and proxies that do not support HTTP/1.1 protocol.
Default:
false -
getProxy
public org.apache.http.HttpHost getProxy()Returns HTTP proxy to be used for request execution.Default:
null -
getLocalAddress
Returns local address to be used for request execution.On machines with multiple network interfaces, this parameter can be used to select the network interface from which the connection originates.
Default:
null -
isStaleConnectionCheckEnabled
Deprecated.Determines whether stale connection check is to be used. The stale connection check can cause up to 30 millisecond overhead per request and should be used only when appropriate. For performance critical operations this check should be disabled.Default:
falsesince 4.4 -
getCookieSpec
Determines the name of the cookie specification to be used for HTTP state management.Default:
null -
isRedirectsEnabled
public boolean isRedirectsEnabled()Determines whether redirects should be handled automatically.Default:
true -
isRelativeRedirectsAllowed
public boolean isRelativeRedirectsAllowed()Determines whether relative redirects should be rejected. HTTP specification requires the location value be an absolute URI.Default:
true -
isCircularRedirectsAllowed
public boolean isCircularRedirectsAllowed()Determines whether circular redirects (redirects to the same location) should be allowed. The HTTP spec is not sufficiently clear whether circular redirects are permitted, therefore optionally they can be enabledDefault:
false -
getMaxRedirects
public int getMaxRedirects()Returns the maximum number of redirects to be followed. The limit on number of redirects is intended to prevent infinite loops.Default:
50 -
isAuthenticationEnabled
public boolean isAuthenticationEnabled()Determines whether authentication should be handled automatically.Default:
true -
getTargetPreferredAuthSchemes
Determines the order of preference for supported authentication schemes when authenticating with the target host.Default:
null -
getProxyPreferredAuthSchemes
Determines the order of preference for supported authentication schemes when authenticating with the proxy host.Default:
null -
getConnectionRequestTimeout
public int getConnectionRequestTimeout()Returns the timeout in milliseconds used when requesting a connection from the connection manager.A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default if applicable).
Default:
-1 -
getConnectTimeout
public int getConnectTimeout()Determines the timeout in milliseconds until a connection is established.A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default if applicable).
Default:
-1 -
getSocketTimeout
public int getSocketTimeout()Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets).A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default if applicable).
Default:
-1 -
isDecompressionEnabled
Deprecated.(4.5) UseisContentCompressionEnabled()Determines whether compressed entities should be decompressed automatically.Default:
true- Since:
- 4.4
-
isContentCompressionEnabled
public boolean isContentCompressionEnabled()Determines whether the target server is requested to compress content.Default:
true- Since:
- 4.5
-
isNormalizeUri
public boolean isNormalizeUri()Determines whether client should normalize URIs in requests or not.Default:
true- Since:
- 4.5.8
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
toString
-
custom
-
copy
-
isContentCompressionEnabled()