Class HttpClient
- All Implemented Interfaces:
Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
HttpClient
provides an efficient, asynchronous, non-blocking implementation
to perform HTTP requests to a server through a simple API that offers also blocking semantic.
HttpClient
provides easy-to-use methods such as GET(String)
that allow to perform HTTP
requests in a one-liner, but also gives the ability to fine tune the configuration of requests via
newRequest(URI)
.
HttpClient
acts as a central configuration point for network parameters (such as idle timeouts)
and HTTP parameters (such as whether to follow redirects).
HttpClient
transparently pools connections to servers, but allows direct control of connections
for cases where this is needed.
HttpClient
also acts as a central configuration point for cookies, via getCookieStore()
.
Typical usage:
HttpClient httpClient = new HttpClient(); httpClient.start(); // One liner: httpClient.GET("http://localhost:8080/").getStatus(); // Building a request with a timeout ContentResponse response = httpClient.newRequest("http://localhost:8080") .timeout(5, TimeUnit.SECONDS) .send(); int status = response.status(); // Asynchronously httpClient.newRequest("http://localhost:8080").send(new Response.CompleteListener() { @Override public void onComplete(Result result) { ... } });
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private HttpField
private AuthenticationStore
private SocketAddress
private ByteBufferPool
private boolean
private long
private CookieManager
private CookieStore
private final Set
<ContentDecoder.Factory> private String
private final ConcurrentMap
<Origin, HttpDestination> private HttpField
private Executor
private boolean
private final ProtocolHandlers
private HttpCompliance
private long
private static final Logger
private int
private int
private int
private String
private final ProxyConfiguration
private boolean
private int
private final List
<Request.Listener> private SocketAddressResolver
private int
private Scheduler
private final SslContextFactory
private boolean
private boolean
private final HttpClientTransport
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aHttpClient
instance that can perform requests to non-TLS destinations only (that is, requests with the "http" scheme only, and not "https").HttpClient
(HttpClientTransport transport) Creates aHttpClient
instance that can perform requests to non-TLS destinations only (that is, requests with the "http" scheme only, and not "https").HttpClient
(HttpClientTransport transport, SslContextFactory sslContextFactory) HttpClient
(SslContextFactory sslContextFactory) Creates aHttpClient
instance that can perform requests to non-TLS and TLS destinations (that is, both requests with the "http" scheme and with the "https" scheme). -
Method Summary
Modifier and TypeMethodDescriptionprivate URI
Checksuri
for the host to be non-null host.protected Request
copyRequest
(HttpRequest oldRequest, URI newURI) protected Origin
createOrigin
(String scheme, String host, int port, Object tag) protected HttpDestination
destinationFor
(String scheme, String host, int port) protected void
doStart()
Starts the managed lifecycle beans in the order they were added.protected void
doStop()
Stops the managed lifecycle beans in the reverse order they were added.void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.protected ProtocolHandler
findProtocolHandler
(Request request, Response response) Performs a POST request to the specified URI with the given form parameters.Performs a POST request to the specified URI with the given form parameters.Performs a GET request to the specified URI.Performs a GET request to the specified URI.protected HttpField
long
long
Returns a non thread-safe set ofContentDecoder.Factory
s that can be modified before performing requests.(package private) CookieManager
Keep this method package-private because its interface is so ugly that we really don't want to expose it more than strictly needed.getDestination
(String scheme, String host, int port) Returns aDestination
for the given scheme, host and port.Gets the http compliance mode for parsing http responses.long
int
int
int
getName()
int
Returns a non thread-safe list ofRequest.Listener
s that can be modified before performing requests.int
boolean
boolean
isDefaultPort
(String scheme, int port) boolean
Deprecated.boolean
boolean
(package private) static boolean
isSchemeSecure
(String scheme) boolean
boolean
protected void
newConnection
(HttpDestination destination, Promise<Connection> promise) private HttpConversation
private CookieManager
protected HttpRequest
newHttpRequest
(HttpConversation conversation, URI uri) newRequest
(String uri) Creates a new request with the specified absolute URI in string format.newRequest
(String host, int port) Creates a new request with the "http" scheme and the specified host and portnewRequest
(URI uri) Creates a new request with the specified absolute URI.protected ClientConnectionFactory
newSslClientConnectionFactory
(ClientConnectionFactory connectionFactory) Deprecated.protected ClientConnectionFactory
newSslClientConnectionFactory
(SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory) protected String
normalizeHost
(String host) Deprecated.no replacement, do not use itstatic int
normalizePort
(String scheme, int port) Creates a POST request to the specified URI.Creates a POST request to the specified URI.protected boolean
removeDestination
(HttpDestination destination) protected HttpDestination
resolveDestination
(String scheme, String host, int port, Object tag) resolveDestination
(Origin origin) Returns, creating it if absent, the destination with the given origin.protected void
send
(HttpRequest request, List<Response.ResponseListener> listeners) void
setAddressResolutionTimeout
(long addressResolutionTimeout) Sets the socket address resolution timeout used by the defaultSocketAddressResolver
created by thisHttpClient
at startup.void
setAuthenticationStore
(AuthenticationStore authenticationStore) void
setBindAddress
(SocketAddress bindAddress) void
setByteBufferPool
(ByteBufferPool byteBufferPool) void
setConnectBlocking
(boolean connectBlocking) Whetherconnect()
operations are performed in blocking mode.void
setConnectTimeout
(long connectTimeout) void
setCookieStore
(CookieStore cookieStore) void
setDefaultRequestContentType
(String contentType) void
setDispatchIO
(boolean dispatchIO) Deprecated.void
setExecutor
(Executor executor) void
setFollowRedirects
(boolean follow) void
setHttpCompliance
(HttpCompliance httpCompliance) Sets the http compliance mode for parsing http responses.void
setIdleTimeout
(long idleTimeout) void
setMaxConnectionsPerDestination
(int maxConnectionsPerDestination) Sets the max number of connections to open to each destinations.void
setMaxRedirects
(int maxRedirects) void
setMaxRequestsQueuedPerDestination
(int maxRequestsQueuedPerDestination) Sets the max number of requests that may be queued to a destination.void
Sets the name of this HttpClient.void
setRemoveIdleDestinations
(boolean removeIdleDestinations) Whether destinations that have no connections (nor active nor idle) should be removed.void
setRequestBufferSize
(int requestBufferSize) void
setResponseBufferSize
(int responseBufferSize) void
setScheduler
(Scheduler scheduler) void
void
setStrictEventOrdering
(boolean strictEventOrdering) Whether request/response events must be strictly ordered with respect to connection usage.void
setTCPNoDelay
(boolean tcpNoDelay) void
setUserAgentField
(HttpField agent) Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Field Details
-
LOG
-
destinations
-
handlers
-
requestListeners
-
decoderFactories
-
proxyConfig
-
transport
-
sslContextFactory
-
authenticationStore
-
cookieManager
-
cookieStore
-
executor
-
byteBufferPool
-
scheduler
-
resolver
-
agentField
-
followRedirects
private boolean followRedirects -
maxConnectionsPerDestination
private int maxConnectionsPerDestination -
maxRequestsQueuedPerDestination
private int maxRequestsQueuedPerDestination -
requestBufferSize
private int requestBufferSize -
responseBufferSize
private int responseBufferSize -
maxRedirects
private int maxRedirects -
bindAddress
-
connectTimeout
private long connectTimeout -
addressResolutionTimeout
private long addressResolutionTimeout -
idleTimeout
private long idleTimeout -
tcpNoDelay
private boolean tcpNoDelay -
strictEventOrdering
private boolean strictEventOrdering -
encodingField
-
removeIdleDestinations
private boolean removeIdleDestinations -
connectBlocking
private boolean connectBlocking -
name
-
httpCompliance
-
defaultRequestContentType
-
-
Constructor Details
-
HttpClient
public HttpClient()Creates aHttpClient
instance that can perform requests to non-TLS destinations only (that is, requests with the "http" scheme only, and not "https").- See Also:
-
HttpClient
Creates aHttpClient
instance that can perform requests to non-TLS and TLS destinations (that is, both requests with the "http" scheme and with the "https" scheme).- Parameters:
sslContextFactory
- theSslContextFactory
that manages TLS encryption- See Also:
-
HttpClient
Creates aHttpClient
instance that can perform requests to non-TLS destinations only (that is, requests with the "http" scheme only, and not "https").- Parameters:
transport
- theHttpClientTransport
- See Also:
-
HttpClient
-
-
Method Details
-
dump
Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dump
in interfaceDumpable
- Overrides:
dump
in classContainerLifeCycle
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-
getTransport
-
getSslContextFactory
- Returns:
- the
SslContextFactory
that manages TLS encryption - See Also:
-
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classContainerLifeCycle
- Throws:
Exception
-
newCookieManager
-
doStop
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
Exception
-
getRequestListeners
Returns a non thread-safe list ofRequest.Listener
s that can be modified before performing requests.- Returns:
- a list of
Request.Listener
that can be used to add and remove listeners
-
getCookieStore
- Returns:
- the cookie store associated with this instance
-
setCookieStore
- Parameters:
cookieStore
- the cookie store associated with this instance
-
getCookieManager
CookieManager getCookieManager()Keep this method package-private because its interface is so ugly that we really don't want to expose it more than strictly needed.- Returns:
- the cookie manager
-
getAuthenticationStore
- Returns:
- the authentication store associated with this instance
-
setAuthenticationStore
- Parameters:
authenticationStore
- the authentication store associated with this instance
-
getContentDecoderFactories
Returns a non thread-safe set ofContentDecoder.Factory
s that can be modified before performing requests.- Returns:
- a set of
ContentDecoder.Factory
that can be used to add and remove content decoder factories
-
GET
public ContentResponse GET(String uri) throws InterruptedException, ExecutionException, TimeoutException Performs a GET request to the specified URI.- Parameters:
uri
- the URI to GET- Returns:
- the
ContentResponse
for the request - Throws:
InterruptedException
- if send threading has been interruptedExecutionException
- the execution failedTimeoutException
- the send timed out- See Also:
-
GET
public ContentResponse GET(URI uri) throws InterruptedException, ExecutionException, TimeoutException Performs a GET request to the specified URI.- Parameters:
uri
- the URI to GET- Returns:
- the
ContentResponse
for the request - Throws:
InterruptedException
- if send threading has been interruptedExecutionException
- the execution failedTimeoutException
- the send timed out- See Also:
-
FORM
public ContentResponse FORM(String uri, Fields fields) throws InterruptedException, ExecutionException, TimeoutException Performs a POST request to the specified URI with the given form parameters.- Parameters:
uri
- the URI to POSTfields
- the fields composing the form name/value pairs- Returns:
- the
ContentResponse
for the request - Throws:
InterruptedException
- if send threading has been interruptedExecutionException
- the execution failedTimeoutException
- the send timed out
-
FORM
public ContentResponse FORM(URI uri, Fields fields) throws InterruptedException, ExecutionException, TimeoutException Performs a POST request to the specified URI with the given form parameters.- Parameters:
uri
- the URI to POSTfields
- the fields composing the form name/value pairs- Returns:
- the
ContentResponse
for the request - Throws:
InterruptedException
- if send threading has been interruptedExecutionException
- the execution failedTimeoutException
- the send timed out
-
POST
Creates a POST request to the specified URI.- Parameters:
uri
- the URI to POST to- Returns:
- the POST request
- See Also:
-
POST
Creates a POST request to the specified URI.- Parameters:
uri
- the URI to POST to- Returns:
- the POST request
-
newRequest
Creates a new request with the "http" scheme and the specified host and port- Parameters:
host
- the request hostport
- the request port- Returns:
- the request just created
-
newRequest
Creates a new request with the specified absolute URI in string format.- Parameters:
uri
- the request absolute URI- Returns:
- the request just created
-
newRequest
Creates a new request with the specified absolute URI.- Parameters:
uri
- the request absolute URI- Returns:
- the request just created
-
copyRequest
-
newHttpRequest
-
checkHost
Checks
uri
for the host to be non-null host.URIs built from strings that have an internationalized domain name (IDN) are parsed without errors, but
uri.getHost()
returns null.- Parameters:
uri
- the URI to check for non-null host- Returns:
- the same
uri
if the host is non-null - Throws:
IllegalArgumentException
- if the host is null
-
getDestination
Returns aDestination
for the given scheme, host and port. Applications may useDestination
s to createConnection
s that will be outsideHttpClient
's pooling mechanism, to explicitly control the connection lifecycle (in particular their termination withConnection.close()
).- Parameters:
scheme
- the destination schemehost
- the destination hostport
- the destination port- Returns:
- the destination
- See Also:
-
destinationFor
-
resolveDestination
-
createOrigin
-
resolveDestination
Returns, creating it if absent, the destination with the given origin.
- Parameters:
origin
- the origin that identifies the destination- Returns:
- the destination for the given origin
-
removeDestination
-
getDestinations
- Returns:
- the list of destinations known to this
HttpClient
.
-
send
-
newConnection
-
newConversation
-
getProtocolHandlers
-
findProtocolHandler
-
getByteBufferPool
- Returns:
- the
ByteBufferPool
of thisHttpClient
-
setByteBufferPool
- Parameters:
byteBufferPool
- theByteBufferPool
of thisHttpClient
-
getName
- Returns:
- the name of this HttpClient
-
setName
Sets the name of this HttpClient.
The name is also used to generate the JMX ObjectName of this HttpClient and must be set before the registration of the HttpClient MBean in the MBeanServer.
- Parameters:
name
- the name of this HttpClient
-
getConnectTimeout
@ManagedAttribute("The timeout, in milliseconds, for connect() operations") public long getConnectTimeout()- Returns:
- the max time, in milliseconds, a connection can take to connect to destinations. Zero value means infinite timeout.
-
setConnectTimeout
public void setConnectTimeout(long connectTimeout) - Parameters:
connectTimeout
- the max time, in milliseconds, a connection can take to connect to destinations. Zero value means infinite timeout.- See Also:
-
getAddressResolutionTimeout
public long getAddressResolutionTimeout()- Returns:
- the timeout, in milliseconds, for the default
SocketAddressResolver
created at startup - See Also:
-
setAddressResolutionTimeout
public void setAddressResolutionTimeout(long addressResolutionTimeout) Sets the socket address resolution timeout used by the default
SocketAddressResolver
created by thisHttpClient
at startup.For more fine tuned configuration of socket address resolution, see
setSocketAddressResolver(SocketAddressResolver)
.- Parameters:
addressResolutionTimeout
- the timeout, in milliseconds, for the defaultSocketAddressResolver
created at startup- See Also:
-
getIdleTimeout
@ManagedAttribute("The timeout, in milliseconds, to close idle connections") public long getIdleTimeout()- Returns:
- the max time, in milliseconds, a connection can be idle (that is, without traffic of bytes in either direction)
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout) - Parameters:
idleTimeout
- the max time, in milliseconds, a connection can be idle (that is, without traffic of bytes in either direction)
-
getBindAddress
- Returns:
- the address to bind socket channels to
- See Also:
-
setBindAddress
- Parameters:
bindAddress
- the address to bind socket channels to- See Also:
-
getUserAgentField
- Returns:
- the "User-Agent" HTTP field of this
HttpClient
-
setUserAgentField
- Parameters:
agent
- the "User-Agent" HTTP header string of thisHttpClient
-
isFollowRedirects
- Returns:
- whether this
HttpClient
follows HTTP redirects - See Also:
-
setFollowRedirects
public void setFollowRedirects(boolean follow) - Parameters:
follow
- whether thisHttpClient
follows HTTP redirects- See Also:
-
getExecutor
- Returns:
- the
Executor
of thisHttpClient
-
setExecutor
- Parameters:
executor
- theExecutor
of thisHttpClient
-
getScheduler
- Returns:
- the
Scheduler
of thisHttpClient
-
setScheduler
- Parameters:
scheduler
- theScheduler
of thisHttpClient
-
getSocketAddressResolver
- Returns:
- the
SocketAddressResolver
of thisHttpClient
-
setSocketAddressResolver
- Parameters:
resolver
- theSocketAddressResolver
of thisHttpClient
-
getMaxConnectionsPerDestination
@ManagedAttribute("The max number of connections per each destination") public int getMaxConnectionsPerDestination()- Returns:
- the max number of connections that this
HttpClient
opens toDestination
s
-
setMaxConnectionsPerDestination
public void setMaxConnectionsPerDestination(int maxConnectionsPerDestination) Sets the max number of connections to open to each destinations.RFC 2616 suggests that 2 connections should be opened per each destination, but browsers commonly open 6. If this
HttpClient
is used for load testing, it is common to have only one destination (the server to load test), and it is recommended to set this value to a high value (at least as much as the threads present in theexecutor
).- Parameters:
maxConnectionsPerDestination
- the max number of connections that thisHttpClient
opens toDestination
s
-
getMaxRequestsQueuedPerDestination
@ManagedAttribute("The max number of requests queued per each destination") public int getMaxRequestsQueuedPerDestination()- Returns:
- the max number of requests that may be queued to a
Destination
.
-
setMaxRequestsQueuedPerDestination
public void setMaxRequestsQueuedPerDestination(int maxRequestsQueuedPerDestination) Sets the max number of requests that may be queued to a destination.If this
HttpClient
performs a high rate of requests to a destination, and all the connections managed by that destination are busy with other requests, then new requests will be queued up in the destination. This parameter controls how many requests can be queued before starting to reject them. If thisHttpClient
is used for load testing, it is common to have this parameter set to a high value, although this may impact latency (requests sit in the queue for a long time before being sent).- Parameters:
maxRequestsQueuedPerDestination
- the max number of requests that may be queued to aDestination
.
-
getRequestBufferSize
- Returns:
- the size of the buffer used to write requests
-
setRequestBufferSize
public void setRequestBufferSize(int requestBufferSize) - Parameters:
requestBufferSize
- the size of the buffer used to write requests
-
getResponseBufferSize
- Returns:
- the size of the buffer used to read responses
-
setResponseBufferSize
public void setResponseBufferSize(int responseBufferSize) - Parameters:
responseBufferSize
- the size of the buffer used to read responses
-
getMaxRedirects
public int getMaxRedirects()- Returns:
- the max number of HTTP redirects that are followed in a conversation
- See Also:
-
setMaxRedirects
public void setMaxRedirects(int maxRedirects) - Parameters:
maxRedirects
- the max number of HTTP redirects that are followed in a conversation, or -1 for unlimited redirects- See Also:
-
isTCPNoDelay
@ManagedAttribute(value="Whether the TCP_NODELAY option is enabled", name="tcpNoDelay") public boolean isTCPNoDelay()- Returns:
- whether TCP_NODELAY is enabled
-
setTCPNoDelay
public void setTCPNoDelay(boolean tcpNoDelay) - Parameters:
tcpNoDelay
- whether TCP_NODELAY is enabled- See Also:
-
isDispatchIO
Deprecated.- Returns:
- true to dispatch I/O operations in a different thread, false to execute them in the selector thread
- See Also:
-
setDispatchIO
Deprecated.Whether to dispatch I/O operations from the selector thread to a different thread.This implementation never blocks on I/O operation, but invokes application callbacks that may take time to execute or block on other I/O. If application callbacks are known to take time or block on I/O, then parameter
dispatchIO
should be set to true. If application callbacks are known to be quick and never block on I/O, then parameterdispatchIO
may be set to false.- Parameters:
dispatchIO
- true to dispatch I/O operations in a different thread, false to execute them in the selector thread
-
getHttpCompliance
Gets the http compliance mode for parsing http responses. The default http compliance level isHttpCompliance.RFC7230
which is the latest HTTP/1.1 specification- Returns:
- the HttpCompliance instance
-
setHttpCompliance
Sets the http compliance mode for parsing http responses. This affect how weak theHttpParser
parses http responses and which http protocol level is supported- Parameters:
httpCompliance
- The compliance level which is used to actually parse http responses
-
isStrictEventOrdering
@ManagedAttribute("Whether request/response events must be strictly ordered") public boolean isStrictEventOrdering()- Returns:
- whether request events must be strictly ordered
- See Also:
-
setStrictEventOrdering
public void setStrictEventOrdering(boolean strictEventOrdering) Whether request/response events must be strictly ordered with respect to connection usage.From the point of view of connection usage, the connection can be reused just before the "complete" event notified to
Response.CompleteListener
s (but after the "success" event).When a request/response exchange is completing, the destination may have another request queued to be sent to the server. If the connection for that destination is reused for the second request before the "complete" event of the first exchange, it may happen that the "begin" event of the second request happens before the "complete" event of the first exchange.
Enforcing strict ordering of events so that a "begin" event of a request can never happen before the "complete" event of the previous exchange comes with the cost of increased connection usage. In case of HTTP redirects and strict event ordering, for example, the redirect request will be forced to open a new connection because it is typically sent from the complete listener when the connection cannot yet be reused. When strict event ordering is not enforced, the redirect request will reuse the already open connection making the system more efficient.
The default value for this property is
false
.- Parameters:
strictEventOrdering
- whether request/response events must be strictly ordered
-
isRemoveIdleDestinations
@ManagedAttribute("Whether idle destinations are removed") public boolean isRemoveIdleDestinations()- Returns:
- whether destinations that have no connections should be removed
- See Also:
-
setRemoveIdleDestinations
public void setRemoveIdleDestinations(boolean removeIdleDestinations) Whether destinations that have no connections (nor active nor idle) should be removed.Applications typically make request to a limited number of destinations so keeping destinations around is not a problem for the memory or the GC. However, for applications that hit millions of different destinations (e.g. a spider bot) it would be useful to be able to remove the old destinations that won't be visited anymore and leave space for new destinations.
- Parameters:
removeIdleDestinations
- whether destinations that have no connections should be removed- See Also:
-
isConnectBlocking
- Returns:
- whether
connect()
operations are performed in blocking mode
-
setConnectBlocking
public void setConnectBlocking(boolean connectBlocking) Whether
connect()
operations are performed in blocking mode.If
connect()
are performed in blocking mode, thenSocket.connect(SocketAddress, int)
will be used to connect to servers.Otherwise,
SocketChannel.connect(SocketAddress)
will be used in non-blocking mode, therefore registering forSelectionKey.OP_CONNECT
and finishing the connect operation when the NIO system emits that event.- Parameters:
connectBlocking
- whetherconnect()
operations are performed in blocking mode
-
getDefaultRequestContentType
@ManagedAttribute("The default content type for request content") public String getDefaultRequestContentType()- Returns:
- the default content type for request content
-
setDefaultRequestContentType
- Parameters:
contentType
- the default content type for request content
-
getProxyConfiguration
- Returns:
- the forward proxy configuration
-
getAcceptEncodingField
-
normalizeHost
Deprecated.no replacement, do not use it- Parameters:
host
- the host to normalize- Returns:
- the host itself
-
normalizePort
-
isDefaultPort
-
isSchemeSecure
-
newSslClientConnectionFactory
@Deprecated protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory) Deprecated.Creates a newSslClientConnectionFactory
wrapping the given connection factory.- Parameters:
connectionFactory
- the connection factory to wrap- Returns:
- a new SslClientConnectionFactory
-
newSslClientConnectionFactory
protected ClientConnectionFactory newSslClientConnectionFactory(SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory)
-
newSslClientConnectionFactory(SslContextFactory, ClientConnectionFactory)
instead