- All Implemented Interfaces:
AutoCloseable,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.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 getHttpCookieStore().
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(result ->
{
Response response = result.getResponse();
...
});
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescendant beans ofHttpClientthat implement this interface are made aware of theHttpClientinstance while it is starting.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a HttpClient instance that can perform HTTP/1.1 requests to non-TLS and TLS destinations.HttpClient(HttpClientTransport transport) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected RequestcopyRequest(Request oldRequest, URI newURI) createOrigin(Request request, Origin.Protocol protocol) protected voiddoStart()protected voiddoStop()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.longGet the authentication store associated with this instance.org.eclipse.jetty.io.ByteBufferPoolGet theByteBufferPoolof this HttpClient.longReturns a non thread-safe set ofContentDecoder.Factorys that can be modified before performing requests.longThe default value is 0Get theExecutorof this HttpClient.org.eclipse.jetty.http.HttpComplianceGets the http compliance mode for parsing http responses.org.eclipse.jetty.http.HttpCookieStoreGet the cookie store associated with this instance.longintintintintintgetName()Get the forward proxy configuration.intReturns a non thread-safe container ofRequest.Listeners that allows to add request listeners before performing requests.intorg.eclipse.jetty.util.thread.SchedulerGet theSchedulerof this HttpClient.org.eclipse.jetty.util.SocketAddressResolverGet theSocketAddressResolverof this HttpClient.org.eclipse.jetty.util.ssl.SslContextFactory.ClientDeprecated, for removal: This API element is subject to removal in a future version.org.eclipse.jetty.http.HttpFieldGet the "User-Agent" HTTP field of this HttpClient.booleanbooleanbooleanbooleanbooleanvoidnewConnection(Destination destination, org.eclipse.jetty.util.Promise<Connection> promise) 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.org.eclipse.jetty.io.ClientConnectionFactorynewSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory, org.eclipse.jetty.io.ClientConnectionFactory connectionFactory) static intnormalizePort(String scheme, int port) Return a normalized port suitable for use by Origin and AddressCreates a POST request to the specified URI.Creates a POST request to the specified URI.voidbooleanremoveDestination(Destination destination) resolveDestination(Origin origin) Returns, creating it if absent, the destination with the given origin.resolveDestination(Request request) voidsetAddressResolutionTimeout(long addressResolutionTimeout) Sets the socket address resolution timeout used by the defaultSocketAddressResolvercreated by this HttpClient at startup.voidsetAuthenticationStore(AuthenticationStore authenticationStore) Set the authentication store associated with this instance.voidsetBindAddress(SocketAddress bindAddress) voidsetByteBufferPool(org.eclipse.jetty.io.ByteBufferPool byteBufferPool) Set theByteBufferPoolof this HttpClient.voidsetConnectBlocking(boolean connectBlocking) Whetherconnect()operations are performed in blocking mode.voidsetConnectTimeout(long connectTimeout) voidsetDefaultRequestContentType(String contentType) Set the default content type for request content.voidsetDestinationIdleTimeout(long destinationIdleTimeout) Whether destinations that have no connections (nor active nor idle) and no exchanges should be removed after the specified timeout.voidsetExecutor(Executor executor) Set theExecutorof this HttpClient.voidsetFollowRedirects(boolean follow) voidsetHttpCompliance(org.eclipse.jetty.http.HttpCompliance httpCompliance) Sets the http compliance mode for parsing http responses.voidsetHttpCookieStore(org.eclipse.jetty.http.HttpCookieStore cookieStore) Set the cookie store associated with this instance.voidsetIdleTimeout(long idleTimeout) Set the max time, in milliseconds, a connection can be idle (that is, without traffic of bytes in either direction).voidsetMaxConnectionsPerDestination(int maxConnectionsPerDestination) Sets the max number of connections to open to each destinations.voidsetMaxRedirects(int maxRedirects) voidsetMaxRequestHeadersSize(int maxRequestHeadersSize) Set the max size in bytes of the request headers.voidsetMaxRequestsQueuedPerDestination(int maxRequestsQueuedPerDestination) Sets the max number of requests that may be queued to a destination.voidsetMaxResponseHeadersSize(int maxResponseHeadersSize) Set the max size in bytes of the response headers.voidSets the name of this HttpClient.voidsetRequestBufferSize(int requestBufferSize) Set the size of the buffer (in bytes) used to write requests.voidsetResponseBufferSize(int responseBufferSize) Set the size of the buffer used to read responses.voidsetScheduler(org.eclipse.jetty.util.thread.Scheduler scheduler) Set theSchedulerof this HttpClient.voidsetSocketAddressResolver(org.eclipse.jetty.util.SocketAddressResolver resolver) Set theSocketAddressResolverof this HttpClient.voidsetSslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory) Set theSslContextFactory.Clientthat manages TLS encryption.voidsetStrictEventOrdering(boolean strictEventOrdering) Whether request/response events must be strictly ordered with respect to connection usage.voidsetUseInputDirectByteBuffers(boolean useInputDirectByteBuffers) Set whether to use direct ByteBuffers for reading.voidsetUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers) Set whether to use direct ByteBuffers for writing.voidsetUserAgentField(org.eclipse.jetty.http.HttpField agent) Set the "User-Agent" HTTP header string of this HttpClient.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Field Details
-
USER_AGENT
-
-
Constructor Details
-
HttpClient
public HttpClient()Creates a HttpClient instance that can perform HTTP/1.1 requests to non-TLS and TLS destinations. -
HttpClient
-
-
Method Details
-
getTransport
Deprecated, for removal: This API element is subject to removal in a future version.usegetHttpClientTransport()instead -
getHttpClientTransport
- Returns:
- the
HttpClientTransportassociated with thisHttpClient
-
getSslContextFactory
public org.eclipse.jetty.util.ssl.SslContextFactory.Client getSslContextFactory()- Returns:
- the
SslContextFactory.Clientthat manages TLS encryption
-
setSslContextFactory
public void setSslContextFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory) Set theSslContextFactory.Clientthat manages TLS encryption.- Parameters:
sslContextFactory- theSslContextFactory.Clientthat manages TLS encryption
-
doStart
-
doStop
-
getRequestListeners
Returns a non thread-safe container ofRequest.Listeners that allows to add request listeners before performing requests.- Returns:
- a
RequestListenersinstance that can be used to add request listeners
-
getHttpCookieStore
public org.eclipse.jetty.http.HttpCookieStore getHttpCookieStore()Get the cookie store associated with this instance.- Returns:
- the cookie store associated with this instance
-
setHttpCookieStore
public void setHttpCookieStore(org.eclipse.jetty.http.HttpCookieStore cookieStore) Set the cookie store associated with this instance.- Parameters:
cookieStore- the cookie store associated with this instance
-
putCookie
-
getAuthenticationStore
Get the authentication store associated with this instance.- Returns:
- the authentication store associated with this instance
-
setAuthenticationStore
Set the authentication store associated with this instance.- Parameters:
authenticationStore- the authentication store associated with this instance
-
getContentDecoderFactories
Returns a non thread-safe set ofContentDecoder.Factorys that can be modified before performing requests.- Returns:
- a set of
ContentDecoder.Factorythat 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
ContentResponsefor 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
ContentResponsefor 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, org.eclipse.jetty.util.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
ContentResponsefor the request - Throws:
InterruptedException- if send threading has been interruptedExecutionException- the execution failedTimeoutException- the send timed out
-
FORM
public ContentResponse FORM(URI uri, org.eclipse.jetty.util.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
ContentResponsefor the request - Throws:
InterruptedException- if send threading has been interruptedExecutionException- the execution failedTimeoutException- the send timed out
-
POST
-
POST
-
newRequest
-
newRequest
-
newRequest
-
copyRequest
-
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.
-
newConnection
public void newConnection(Destination destination, org.eclipse.jetty.util.Promise<Connection> promise) -
getProtocolHandlers
-
findProtocolHandler
-
getByteBufferPool
public org.eclipse.jetty.io.ByteBufferPool getByteBufferPool()Get theByteBufferPoolof this HttpClient.- Returns:
- the
ByteBufferPoolof this HttpClient
-
setByteBufferPool
public void setByteBufferPool(org.eclipse.jetty.io.ByteBufferPool byteBufferPool) Set theByteBufferPoolof this HttpClient.- Parameters:
byteBufferPool- theByteBufferPoolof this HttpClient
-
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
SocketAddressResolvercreated at startup - See Also:
-
setAddressResolutionTimeout
public void setAddressResolutionTimeout(long addressResolutionTimeout) Sets the socket address resolution timeout used by the default
SocketAddressResolvercreated by this HttpClient at startup.For more fine tuned configuration of socket address resolution, see
setSocketAddressResolver(SocketAddressResolver).- Parameters:
addressResolutionTimeout- the timeout, in milliseconds, for the defaultSocketAddressResolvercreated 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) Set the max time, in milliseconds, a connection can be idle (that is, without traffic of bytes in either direction).- 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
public org.eclipse.jetty.http.HttpField getUserAgentField()Get the "User-Agent" HTTP field of this HttpClient.- Returns:
- the "User-Agent" HTTP field of this HttpClient
-
setUserAgentField
public void setUserAgentField(org.eclipse.jetty.http.HttpField agent) Set the "User-Agent" HTTP header string of this HttpClient.- Parameters:
agent- the "User-Agent" HTTP header string of this HttpClient
-
isFollowRedirects
@ManagedAttribute("Whether HTTP redirects are followed") public boolean isFollowRedirects()- Returns:
- whether this HttpClient follows HTTP redirects
- See Also:
-
setFollowRedirects
public void setFollowRedirects(boolean follow) - Parameters:
follow- whether this HttpClient follows HTTP redirects- See Also:
-
getExecutor
-
setExecutor
-
getScheduler
public org.eclipse.jetty.util.thread.Scheduler getScheduler()Get theSchedulerof this HttpClient.- Returns:
- the
Schedulerof this HttpClient
-
setScheduler
public void setScheduler(org.eclipse.jetty.util.thread.Scheduler scheduler) Set theSchedulerof this HttpClient.- Parameters:
scheduler- theSchedulerof this HttpClient
-
getSocketAddressResolver
public org.eclipse.jetty.util.SocketAddressResolver getSocketAddressResolver()Get theSocketAddressResolverof this HttpClient.- Returns:
- the
SocketAddressResolverof this HttpClient
-
setSocketAddressResolver
public void setSocketAddressResolver(org.eclipse.jetty.util.SocketAddressResolver resolver) Set theSocketAddressResolverof this HttpClient.- Parameters:
resolver- theSocketAddressResolverof this HttpClient
-
getMaxConnectionsPerDestination
@ManagedAttribute("The max number of connections per each destination") public int getMaxConnectionsPerDestination()- Returns:
- the max number of connections that this HttpClient opens to
Destinations
-
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 the
executor).- Parameters:
maxConnectionsPerDestination- the max number of connections that this HttpClient opens toDestinations
-
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 this HttpClient 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
@ManagedAttribute("The request buffer size in bytes") public int getRequestBufferSize()- Returns:
- the size of the buffer (in bytes) used to write requests
-
setRequestBufferSize
public void setRequestBufferSize(int requestBufferSize) Set the size of the buffer (in bytes) used to write requests.- Parameters:
requestBufferSize- the size of the buffer (in bytes) used to write requests
-
getResponseBufferSize
@ManagedAttribute("The response buffer size in bytes") public int getResponseBufferSize()- Returns:
- the size of the buffer (in bytes) used to read responses
-
setResponseBufferSize
public void setResponseBufferSize(int responseBufferSize) Set the size of the buffer used to read responses.- 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:
-
getHttpCompliance
public org.eclipse.jetty.http.HttpCompliance getHttpCompliance()Gets the http compliance mode for parsing http responses. The default http compliance level isHttpCompliance.RFC9110which is the latest HTTP specification- Returns:
- the HttpCompliance instance
-
setHttpCompliance
public void setHttpCompliance(org.eclipse.jetty.http.HttpCompliance httpCompliance) Sets the http compliance mode for parsing http responses. This affect how weak theHttpParserparses 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.CompleteListeners (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
-
getDestinationIdleTimeout
@ManagedAttribute("The time in ms after which idle destinations are removed, disabled when zero or negative") public long getDestinationIdleTimeout()The default value is 0- Returns:
- the time in ms after which idle destinations are removed
- See Also:
-
setDestinationIdleTimeout
public void setDestinationIdleTimeout(long destinationIdleTimeout) Whether destinations that have no connections (nor active nor idle) and no exchanges should be removed after the specified timeout.
If the specified
destinationIdleTimeoutis 0 or negative, then the destinations are not removed.Avoids accumulating destinations when applications (e.g. a spider bot or web crawler) hit a lot of different destinations that won't be visited again.
- Parameters:
destinationIdleTimeout- the time in ms after which idle destinations are removed
-
isConnectBlocking
@ManagedAttribute("Whether the connect() operation is blocking") public boolean 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_CONNECTand 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
Set the default content type for request content.- Parameters:
contentType- the default content type for request content
-
isUseInputDirectByteBuffers
@ManagedAttribute("Whether to use direct ByteBuffers for reading") public boolean isUseInputDirectByteBuffers()- Returns:
- whether to use direct ByteBuffers for reading
-
setUseInputDirectByteBuffers
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers) Set whether to use direct ByteBuffers for reading.- Parameters:
useInputDirectByteBuffers- whether to use direct ByteBuffers for reading
-
getMaxRequestHeadersSize
@ManagedAttribute("The max size in bytes of the request headers") public int getMaxRequestHeadersSize()- Returns:
- the max size in bytes of the request headers
-
setMaxRequestHeadersSize
public void setMaxRequestHeadersSize(int maxRequestHeadersSize) Set the max size in bytes of the request headers.- Parameters:
maxRequestHeadersSize- the max size in bytes of the request headers
-
isUseOutputDirectByteBuffers
@ManagedAttribute("Whether to use direct ByteBuffers for writing") public boolean isUseOutputDirectByteBuffers()- Returns:
- whether to use direct ByteBuffers for writing
-
setUseOutputDirectByteBuffers
public void setUseOutputDirectByteBuffers(boolean useOutputDirectByteBuffers) Set whether to use direct ByteBuffers for writing.- Parameters:
useOutputDirectByteBuffers- whether to use direct ByteBuffers for writing
-
getMaxResponseHeadersSize
@ManagedAttribute("The max size in bytes of the response headers") public int getMaxResponseHeadersSize()- Returns:
- the max size in bytes of the response headers
-
setMaxResponseHeadersSize
public void setMaxResponseHeadersSize(int maxResponseHeadersSize) Set the max size in bytes of the response headers.- Parameters:
maxResponseHeadersSize- the max size in bytes of the response headers
-
getProxyConfiguration
Get the forward proxy configuration.- Returns:
- the forward proxy configuration
-
normalizePort
Return a normalized port suitable for use by Origin and Address- Parameters:
scheme- the scheme to use for the default port (if port is unspecified)port- the port (0 or negative means the port is unspecified)- Returns:
- the normalized port.
-
newSslClientConnectionFactory
public org.eclipse.jetty.io.ClientConnectionFactory newSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory, org.eclipse.jetty.io.ClientConnectionFactory connectionFactory) -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getHttpClientTransport()instead