Class HttpClientOptions
java.lang.Object
io.vertx.core.net.NetworkOptions
io.vertx.core.net.TCPSSLOptions
io.vertx.core.net.ClientOptionsBase
io.vertx.core.http.HttpClientOptions
- Direct Known Subclasses:
HttpSenderOptions, WebClientOptions
Options describing how an
HttpClient will make connections.- Author:
- Tim Fox
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<HttpVersion> Default Application-Layer Protocol Negotiation versions = [] (automatic according to protocol version)static final intDefault initial buffer size for HttpObjectDecoder = 128 bytesstatic final booleanWhether the client should send requests with anaccepting-encodingheader set to a compression algorithm by default =falsestatic final StringThe default value for host name = "localhost"static final intThe default value for port = 80static final booleanFollow alternative service server advertisements =falsestatic final booleanstatic final booleanUse HTTP/2 multiplex implementation =falsestatic final booleanDefault using HTTP/1.1 upgrade for establishing an h2C connection =truestatic final booleanDefault to use a preflight OPTIONS request for h2C without prior knowledge connection =falsestatic final intThe default connection window size for HTTP/2 = -1static final intThe default keep alive timeout for HTTP/2 connection can send = 60 secondsstatic final intThe default maximum number of concurrent streams per connection for HTTP/2 = -1static final intDefault maximum length of the aggregated content in bytesstatic final booleanDefault value of whether keep-alive is enabled =truestatic final intThe default keep alive timeout for HTTP/1.1 connection can send = 60 secondsstatic final intDefault max HTTP chunk size = 8192static final intDefault max length of all headers = 8192static final intDefault max length of the initial line (e.g.static final intstatic final StringActual name of anonymous shared client =__vertx.DEFAULTstatic final booleanDefault value of whether pipe-lining is enabled =falsestatic final intThe default maximum number of requests an HTTP/1.1 pipe-lined connection can send = 10static final HttpVersionThe default protocol version = HTTP/1.1static final booleanDefault shared client =falsestatic final TracingPolicyDefault tracing control =TracingPolicy.PROPAGATEstatic final booleanDefault value of whether hostname verification (for SSL/TLS) is enabled =trueFields inherited from class ClientOptionsBase
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAMEFields inherited from class TCPSSLOptions
DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEAPLIVE_COUNT, DEFAULT_TCP_KEEAPLIVE_IDLE_SECONDS, DEFAULT_TCP_KEEAPLIVE_INTERVAL_SECONDS, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_WRITE_IDLE_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCopy constructorHttpClientOptions(JsonObject json) Constructor to create an options from JSONCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionaddCrlPath(String crlPath) Add a CRL pathaddCrlValue(Buffer crlValue) Add a CRL valueaddEnabledCipherSuite(String suite) Add an enabled cipher suite, appended to the ordered suites.addEnabledSecureTransportProtocol(String protocol) Add an enabled SSL/TLS protocols, appended to the ordered protocols.addNonProxyHost(String nonProxyHost) Add ahostto theClientOptionsBase.getNonProxyHosts()list.protected ClientSSLOptionsintGet the default host name to be used by this client in requests if none is provided when making the request.intGet the default port to be used by this client in requests if none is provided when making the request.booleanintintbooleanintintintintReturns the maximum HTTP chunk sizeintintintgetName()intGet the protocol version.booleanbooleanbooleanbooleanbooleanIs keep alive enabled on the client?booleanIs pipe-lining enabled on the clientbooleanisShared()booleanIs hostname verification (for SSL/TLS) enabled?removeEnabledCipherSuite(String suite) Removes an enabled cipher suite from the ordered suites.removeEnabledSecureTransportProtocol(String protocol) Removes an enabled SSL/TLS protocol from the ordered protocols.setActivityLogDataFormat(ByteBufFormat activityLogDataFormat) Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.setAlpnVersions(List<HttpVersion> alpnVersions) Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation.setConnectTimeout(int connectTimeout) Set the connect timeoutsetDecoderInitialBufferSize(int decoderInitialBufferSize) set toinitialBufferSizeHttpDecoderthe initial buffer of the HttpDecoder.setDecompressionSupported(boolean decompressionSupported) Whether the client should send requests with anaccepting-encodingheader set to a compression algorithm.setDefaultHost(String defaultHost) Set the default host name to be used by this client in requests if none is provided when making the request.setDefaultPort(int defaultPort) Set the default port to be used by this client in requests if none is provided when making the request.setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols) Sets the list of enabled SSL/TLS protocols.setFollowAlternativeServices(boolean followAlternativeServices) Configure whether the client follows alternative services advertisements, the default setting does not.setForceSni(boolean forceSni) By default, the server name is only sent for Fully Qualified Domain Name (FQDN), setting this property totrueforces the server name to be always sent.setHttp2ClearTextUpgrade(boolean value) Set totruewhen an h2c connection is established using an HTTP/1.1 upgrade request, andfalsewhen an h2c connection is established directly (with prior knowledge).setHttp2ClearTextUpgradeWithPreflightRequest(boolean value) Set totruewhen an h2c connection established using an HTTP/1.1 upgrade request should perform a preflightOPTIONSrequest to the origin server to establish the h2c connection.setHttp2ConnectionWindowSize(int http2ConnectionWindowSize) Set the default HTTP/2 connection window size.setHttp2KeepAliveTimeout(int keepAliveTimeout) Set the keep alive timeout for HTTP/2 connections, in seconds.setHttp2MultiplexImplementation(boolean http2MultiplexImplementation) Set which HTTP/2 implementation to usesetHttp2MultiplexingLimit(int limit) Set a client limit of the number concurrent streams for each HTTP/2 connection, this limits the number of streams the client can create for a connection.setHttp2UpgradeMaxContentLength(int http2UpgradeMaxContentLength) Set the HTTP/2 upgrade maximum length of the aggregated content in bytes.setIdleTimeout(int idleTimeout) Set the idle timeout, default time unit is seconds.setIdleTimeoutUnit(TimeUnit idleTimeoutUnit) Set the idle timeout unit.setInitialSettings(Http2Settings settings) Set the HTTP/2 connection settings immediately sent by to the server when the client connects.setKeepAlive(boolean keepAlive) Set whether keep alive is enabled on the clientsetKeepAliveTimeout(int keepAliveTimeout) Set the keep alive timeout for HTTP/1.x, in seconds.setKeyCertOptions(KeyCertOptions options) Set the key/cert options.setLocalAddress(String localAddress) Set the local interface to bind for network connections.setLogActivity(boolean logEnabled) Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.setMaxChunkSize(int maxChunkSize) Set the maximum HTTP chunk sizesetMaxHeaderSize(int maxHeaderSize) Set the maximum length of all headers for HTTP/1.x .setMaxInitialLineLength(int maxInitialLineLength) Set the maximum length of the initial line for HTTP/1.x (e.g.setMaxRedirects(int maxRedirects) Set tomaxRedirectsthe maximum number of redirection a request can follow.setMetricsName(String metricsName) Set the metrics name identifying the reported metrics, useful for grouping metrics with the same name.Set the client name, used when the client is shared, otherwise ignored.setNonProxyHosts(List<String> nonProxyHosts) Set a list of remote hosts that are not proxied when the client is configured to use a proxy.setPipelining(boolean pipelining) Set whether pipe-lining is enabled on the clientsetPipeliningLimit(int limit) Set the limit of pending requests a pipe-lined HTTP/1 connection can send.setProtocolVersion(HttpVersion protocolVersion) Set the protocol version.setProxyOptions(ProxyOptions proxyOptions) Set proxy options for connections via CONNECT proxy (e.g.setReadIdleTimeout(int idleTimeout) Set the read idle timeout, default time unit is seconds.setReceiveBufferSize(int receiveBufferSize) Set the TCP receive buffer sizesetReuseAddress(boolean reuseAddress) Set the value of reuse addresssetReusePort(boolean reusePort) Set the value of reuse port.setSendBufferSize(int sendBufferSize) Set the TCP send buffer sizesetShared(boolean shared) Set totrueto share the client.setSoLinger(int soLinger) Set whether SO_linger keep alive is enabledsetSsl(boolean ssl) Set whether SSL/TLS is enabledsetSslEngineOptions(SSLEngineOptions sslEngineOptions) Set to use SSL engine implementation to use.setSslHandshakeTimeout(long sslHandshakeTimeout) Set the SSL handshake timeout, default time unit is seconds.setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit) Set the SSL handshake timeout unit.setTcpCork(boolean tcpCork) Enable theTCP_CORKoption - only with linux native transport.setTcpFastOpen(boolean tcpFastOpen) Enable theTCP_FASTOPENoption - only with linux native transport.setTcpKeepAlive(boolean tcpKeepAlive) Set whether TCP keep alive is enabledsetTcpNoDelay(boolean tcpNoDelay) Set whether TCP no delay is enabledsetTcpQuickAck(boolean tcpQuickAck) Enable theTCP_QUICKACKoption - only with linux native transport.setTcpUserTimeout(int tcpUserTimeout) Sets theTCP_USER_TIMEOUToption - only with linux native transport.setTracingPolicy(TracingPolicy tracingPolicy) Set the tracing policy for the client behavior when Vert.x has tracing enabled.setTrafficClass(int trafficClass) Set the value of traffic classsetTrustAll(boolean trustAll) Set whether all server certificates should be trustedsetTrustOptions(TrustOptions options) Set the trust options.setUseAlpn(boolean useAlpn) Set the ALPN usage.setVerifyHost(boolean verifyHost) Set whether hostname verification is enabledsetWriteIdleTimeout(int idleTimeout) Set the write idle timeout, default time unit is seconds.toJson()Convert to JSONMethods inherited from class ClientOptionsBase
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getOrCreateSSLOptions, getProxyOptions, getSslOptions, isTrustAllMethods inherited from class TCPSSLOptions
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getKeyCertOptions, getReadIdleTimeout, getReceiveBufferSize, getSendBufferSize, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getTcpKeepAliveCount, getTcpKeepAliveIdleSeconds, getTcpKeepAliveIntervalSeconds, getTcpUserTimeout, getTrafficClass, getTransportOptions, getTrustOptions, getWriteIdleTimeout, isReuseAddress, isReusePort, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn, setTcpKeepAliveCount, setTcpKeepAliveIdleSeconds, setTcpKeepAliveIntervalSecondsMethods inherited from class NetworkOptions
getActivityLogDataFormat, getLogActivity
-
Field Details
-
DEFAULT_HTTP2_MULTIPLEXING_LIMIT
public static final int DEFAULT_HTTP2_MULTIPLEXING_LIMITThe default maximum number of concurrent streams per connection for HTTP/2 = -1- See Also:
-
DEFAULT_HTTP2_CONNECTION_WINDOW_SIZE
public static final int DEFAULT_HTTP2_CONNECTION_WINDOW_SIZEThe default connection window size for HTTP/2 = -1- See Also:
-
DEFAULT_HTTP2_KEEP_ALIVE_TIMEOUT
public static final int DEFAULT_HTTP2_KEEP_ALIVE_TIMEOUTThe default keep alive timeout for HTTP/2 connection can send = 60 seconds- See Also:
-
DEFAULT_KEEP_ALIVE
public static final boolean DEFAULT_KEEP_ALIVEDefault value of whether keep-alive is enabled =true- See Also:
-
DEFAULT_PIPELINING
public static final boolean DEFAULT_PIPELININGDefault value of whether pipe-lining is enabled =false- See Also:
-
DEFAULT_PIPELINING_LIMIT
public static final int DEFAULT_PIPELINING_LIMITThe default maximum number of requests an HTTP/1.1 pipe-lined connection can send = 10- See Also:
-
DEFAULT_KEEP_ALIVE_TIMEOUT
public static final int DEFAULT_KEEP_ALIVE_TIMEOUTThe default keep alive timeout for HTTP/1.1 connection can send = 60 seconds- See Also:
-
DEFAULT_DECOMPRESSION_SUPPORTED
public static final boolean DEFAULT_DECOMPRESSION_SUPPORTEDWhether the client should send requests with anaccepting-encodingheader set to a compression algorithm by default =false- See Also:
-
DEFAULT_VERIFY_HOST
public static final boolean DEFAULT_VERIFY_HOSTDefault value of whether hostname verification (for SSL/TLS) is enabled =true- See Also:
-
DEFAULT_DEFAULT_HOST
The default value for host name = "localhost"- See Also:
-
DEFAULT_DEFAULT_PORT
public static final int DEFAULT_DEFAULT_PORTThe default value for port = 80- See Also:
-
DEFAULT_PROTOCOL_VERSION
The default protocol version = HTTP/1.1 -
DEFAULT_MAX_CHUNK_SIZE
public static final int DEFAULT_MAX_CHUNK_SIZEDefault max HTTP chunk size = 8192- See Also:
-
DEFAULT_MAX_INITIAL_LINE_LENGTH
public static final int DEFAULT_MAX_INITIAL_LINE_LENGTHDefault max length of the initial line (e.g."HTTP/1.1 200 OK") = 4096- See Also:
-
DEFAULT_MAX_HEADER_SIZE
public static final int DEFAULT_MAX_HEADER_SIZEDefault max length of all headers = 8192- See Also:
-
DEFAULT_ALPN_VERSIONS
Default Application-Layer Protocol Negotiation versions = [] (automatic according to protocol version) -
DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE
public static final boolean DEFAULT_HTTP2_CLEAR_TEXT_UPGRADEDefault using HTTP/1.1 upgrade for establishing an h2C connection =true- See Also:
-
DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE_WITH_PREFLIGHT_REQUEST
public static final boolean DEFAULT_HTTP2_CLEAR_TEXT_UPGRADE_WITH_PREFLIGHT_REQUESTDefault to use a preflight OPTIONS request for h2C without prior knowledge connection =false- See Also:
-
DEFAULT_HTTP2_UPGRADE_MAX_CONTENT_LENGTH
public static final int DEFAULT_HTTP2_UPGRADE_MAX_CONTENT_LENGTHDefault maximum length of the aggregated content in bytes- See Also:
-
DEFAULT_MAX_REDIRECTS
public static final int DEFAULT_MAX_REDIRECTS- See Also:
-
DEFAULT_FORCE_SNI
public static final boolean DEFAULT_FORCE_SNI- See Also:
-
DEFAULT_DECODER_INITIAL_BUFFER_SIZE
public static final int DEFAULT_DECODER_INITIAL_BUFFER_SIZEDefault initial buffer size for HttpObjectDecoder = 128 bytes- See Also:
-
DEFAULT_TRACING_POLICY
Default tracing control =TracingPolicy.PROPAGATE -
DEFAULT_SHARED
public static final boolean DEFAULT_SHAREDDefault shared client =false- See Also:
-
DEFAULT_NAME
Actual name of anonymous shared client =__vertx.DEFAULT- See Also:
-
DEFAULT_HTTP_2_MULTIPLEX_IMPLEMENTATION
public static final boolean DEFAULT_HTTP_2_MULTIPLEX_IMPLEMENTATIONUse HTTP/2 multiplex implementation =false- See Also:
-
DEFAULT_FOLLOW_ALTERNATIVE_SERVICES
public static final boolean DEFAULT_FOLLOW_ALTERNATIVE_SERVICESFollow alternative service server advertisements =false- See Also:
-
-
Constructor Details
-
HttpClientOptions
public HttpClientOptions()Default constructor -
HttpClientOptions
Copy constructor- Parameters:
other- the options to copy
-
HttpClientOptions
Copy constructor- Parameters:
other- the options to copy
-
HttpClientOptions
Constructor to create an options from JSON- Parameters:
json- the JSON
-
-
Method Details
-
toJson
Convert to JSON- Overrides:
toJsonin classClientOptionsBase- Returns:
- the JSON
-
getHttp1Config
-
getHttp2Config
-
createSSLOptions
- Overrides:
createSSLOptionsin classClientOptionsBase
-
setSendBufferSize
Description copied from class:NetworkOptionsSet the TCP send buffer size- Overrides:
setSendBufferSizein classClientOptionsBase- Parameters:
sendBufferSize- the buffers size, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
setReceiveBufferSize
Description copied from class:NetworkOptionsSet the TCP receive buffer size- Overrides:
setReceiveBufferSizein classClientOptionsBase- Parameters:
receiveBufferSize- the buffers size, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
setReuseAddress
Description copied from class:NetworkOptionsSet the value of reuse address- Overrides:
setReuseAddressin classClientOptionsBase- Parameters:
reuseAddress- the value of reuse address- Returns:
- a reference to this, so the API can be used fluently
-
setReusePort
Description copied from class:NetworkOptionsSet the value of reuse port. This is only supported by native transports.- Overrides:
setReusePortin classClientOptionsBase- Parameters:
reusePort- the value of reuse port- Returns:
- a reference to this, so the API can be used fluently
-
setTrafficClass
Description copied from class:NetworkOptionsSet the value of traffic class- Overrides:
setTrafficClassin classClientOptionsBase- Parameters:
trafficClass- the value of traffic class- Returns:
- a reference to this, so the API can be used fluently
-
setTcpNoDelay
Description copied from class:TCPSSLOptionsSet whether TCP no delay is enabled- Overrides:
setTcpNoDelayin classClientOptionsBase- Parameters:
tcpNoDelay- true if TCP no delay is enabled (Nagle disabled)- Returns:
- a reference to this, so the API can be used fluently
-
setTcpKeepAlive
Description copied from class:TCPSSLOptionsSet whether TCP keep alive is enabled- Overrides:
setTcpKeepAlivein classClientOptionsBase- Parameters:
tcpKeepAlive- true if TCP keep alive is enabled- Returns:
- a reference to this, so the API can be used fluently
-
setSoLinger
Description copied from class:TCPSSLOptionsSet whether SO_linger keep alive is enabled- Overrides:
setSoLingerin classClientOptionsBase- Parameters:
soLinger- true if SO_linger is enabled- Returns:
- a reference to this, so the API can be used fluently
-
setIdleTimeout
Description copied from class:TCPSSLOptionsSet the idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received nor sent within the timeout. If you want change default time unit, useTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)- Overrides:
setIdleTimeoutin classClientOptionsBase- Parameters:
idleTimeout- the timeout- Returns:
- a reference to this, so the API can be used fluently
-
setReadIdleTimeout
Description copied from class:TCPSSLOptionsSet the read idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received within the timeout. If you want change default time unit, useTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)- Overrides:
setReadIdleTimeoutin classClientOptionsBase- Parameters:
idleTimeout- the read timeout- Returns:
- a reference to this, so the API can be used fluently
-
setWriteIdleTimeout
Description copied from class:TCPSSLOptionsSet the write idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is sent within the timeout. If you want change default time unit, useTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)- Overrides:
setWriteIdleTimeoutin classClientOptionsBase- Parameters:
idleTimeout- the write timeout- Returns:
- a reference to this, so the API can be used fluently
-
setIdleTimeoutUnit
Description copied from class:TCPSSLOptionsSet the idle timeout unit. If not specified, default is seconds.- Overrides:
setIdleTimeoutUnitin classClientOptionsBase- Parameters:
idleTimeoutUnit- specify time unit.- Returns:
- a reference to this, so the API can be used fluently
-
setSsl
Description copied from class:TCPSSLOptionsSet whether SSL/TLS is enabled- Overrides:
setSslin classClientOptionsBase- Parameters:
ssl- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setKeyCertOptions
Description copied from class:TCPSSLOptionsSet the key/cert options.- Overrides:
setKeyCertOptionsin classClientOptionsBase- Parameters:
options- the key store options- Returns:
- a reference to this, so the API can be used fluently
-
setTrustOptions
Description copied from class:TCPSSLOptionsSet the trust options.- Overrides:
setTrustOptionsin classClientOptionsBase- Parameters:
options- the trust options- Returns:
- a reference to this, so the API can be used fluently
-
addEnabledCipherSuite
Description copied from class:TCPSSLOptionsAdd an enabled cipher suite, appended to the ordered suites.- Overrides:
addEnabledCipherSuitein classClientOptionsBase- Parameters:
suite- the suite- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
removeEnabledCipherSuite
Description copied from class:TCPSSLOptionsRemoves an enabled cipher suite from the ordered suites.- Overrides:
removeEnabledCipherSuitein classClientOptionsBase- Parameters:
suite- the suite- Returns:
- a reference to this, so the API can be used fluently
-
addEnabledSecureTransportProtocol
Description copied from class:TCPSSLOptionsAdd an enabled SSL/TLS protocols, appended to the ordered protocols.- Overrides:
addEnabledSecureTransportProtocolin classClientOptionsBase- Parameters:
protocol- the SSL/TLS protocol to enable- Returns:
- a reference to this, so the API can be used fluently
-
removeEnabledSecureTransportProtocol
Description copied from class:TCPSSLOptionsRemoves an enabled SSL/TLS protocol from the ordered protocols.- Overrides:
removeEnabledSecureTransportProtocolin classClientOptionsBase- Parameters:
protocol- the SSL/TLS protocol to disable- Returns:
- a reference to this, so the API can be used fluently
-
setTcpFastOpen
Description copied from class:TCPSSLOptionsEnable theTCP_FASTOPENoption - only with linux native transport.- Overrides:
setTcpFastOpenin classClientOptionsBase- Parameters:
tcpFastOpen- the fast open value
-
setTcpCork
Description copied from class:TCPSSLOptionsEnable theTCP_CORKoption - only with linux native transport.- Overrides:
setTcpCorkin classClientOptionsBase- Parameters:
tcpCork- the cork value
-
setTcpQuickAck
Description copied from class:TCPSSLOptionsEnable theTCP_QUICKACKoption - only with linux native transport.- Overrides:
setTcpQuickAckin classClientOptionsBase- Parameters:
tcpQuickAck- the quick ack value
-
setTcpUserTimeout
Description copied from class:TCPSSLOptionsSets theTCP_USER_TIMEOUToption - only with linux native transport.- Overrides:
setTcpUserTimeoutin classClientOptionsBase- Parameters:
tcpUserTimeout- the tcp user timeout value
-
addCrlPath
Description copied from class:TCPSSLOptionsAdd a CRL path- Overrides:
addCrlPathin classClientOptionsBase- Parameters:
crlPath- the path- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
addCrlValue
Description copied from class:TCPSSLOptionsAdd a CRL value- Overrides:
addCrlValuein classClientOptionsBase- Parameters:
crlValue- the value- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
setConnectTimeout
Description copied from class:ClientOptionsBaseSet the connect timeout- Overrides:
setConnectTimeoutin classClientOptionsBase- Parameters:
connectTimeout- connect timeout, in ms- Returns:
- a reference to this, so the API can be used fluently
-
setTrustAll
Description copied from class:ClientOptionsBaseSet whether all server certificates should be trusted- Overrides:
setTrustAllin classClientOptionsBase- Parameters:
trustAll- true if all should be trusted- Returns:
- a reference to this, so the API can be used fluently
-
setEnabledSecureTransportProtocols
public HttpClientOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols) Description copied from class:TCPSSLOptionsSets the list of enabled SSL/TLS protocols.- Overrides:
setEnabledSecureTransportProtocolsin classTCPSSLOptions- Parameters:
enabledSecureTransportProtocols- the SSL/TLS protocols to enable- Returns:
- a reference to this, so the API can be used fluently
-
setSslHandshakeTimeout
Description copied from class:TCPSSLOptionsSet the SSL handshake timeout, default time unit is seconds.- Overrides:
setSslHandshakeTimeoutin classTCPSSLOptions- Parameters:
sslHandshakeTimeout- the SSL handshake timeout to set, in milliseconds- Returns:
- a reference to this, so the API can be used fluently
-
setSslHandshakeTimeoutUnit
Description copied from class:TCPSSLOptionsSet the SSL handshake timeout unit. If not specified, default is seconds.- Overrides:
setSslHandshakeTimeoutUnitin classTCPSSLOptions- Parameters:
sslHandshakeTimeoutUnit- specify time unit.- Returns:
- a reference to this, so the API can be used fluently
-
getHttp2MultiplexingLimit
public int getHttp2MultiplexingLimit()- Returns:
- the maximum number of concurrent streams for an HTTP/2 connection,
-1means the value sent by the server
-
setHttp2MultiplexingLimit
Set a client limit of the number concurrent streams for each HTTP/2 connection, this limits the number of streams the client can create for a connection. The effective number of streams for a connection is the min of this value and the server's initial settings. Setting the value to-1means to use the value sent by the server's initial settings.-1is the default value.- Parameters:
limit- the maximum concurrent for an HTTP/2 connection- Returns:
- a reference to this, so the API can be used fluently
-
getHttp2ConnectionWindowSize
public int getHttp2ConnectionWindowSize()- Returns:
- the default HTTP/2 connection window size
-
setHttp2ConnectionWindowSize
Set the default HTTP/2 connection window size. It overrides the initial window size set byHttp2Settings.getInitialWindowSize(), so the connection window size is greater than for its streams, in order the data throughput. A value of-1reuses the initial window size setting.- Parameters:
http2ConnectionWindowSize- the window size applied to the connection- Returns:
- a reference to this, so the API can be used fluently
-
getHttp2KeepAliveTimeout
public int getHttp2KeepAliveTimeout()- Returns:
- the keep alive timeout value in seconds for HTTP/2 connections
-
setHttp2KeepAliveTimeout
Set the keep alive timeout for HTTP/2 connections, in seconds. This value determines how long a connection remains unused in the pool before being evicted and closed. A timeout of0means there is no timeout.- Parameters:
keepAliveTimeout- the timeout, in seconds- Returns:
- a reference to this, so the API can be used fluently
-
getHttp2UpgradeMaxContentLength
public int getHttp2UpgradeMaxContentLength()- Returns:
- the HTTP/2 upgrade maximum length of the aggregated content in bytes
-
setHttp2UpgradeMaxContentLength
Set the HTTP/2 upgrade maximum length of the aggregated content in bytes. This is only taken into account when} is set toinvalid @link
{@link HttpClientOptions#isHttp2ClearTextUpgradeWithPreflightRequest)false(which is the default). WhenisHttp2ClearTextUpgradeWithPreflightRequest()istrue, then the client makes a preflight OPTIONS request and the upgrade will not send a body, voiding the requirements.- Parameters:
http2UpgradeMaxContentLength- the length, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
getHttp2MultiplexImplementation
public boolean getHttp2MultiplexImplementation()- Returns:
- whether to use the HTTP/2 implementation based on multiplexed channel
-
setHttp2MultiplexImplementation
Set which HTTP/2 implementation to use- Parameters:
http2MultiplexImplementation- whether to use the HTTP/2 multiplex implementation- Returns:
- a reference to this, so the API can be used fluently
-
isKeepAlive
public boolean isKeepAlive()Is keep alive enabled on the client?- Returns:
trueif enabled
-
setKeepAlive
Set whether keep alive is enabled on the client- Parameters:
keepAlive-trueif enabled- Returns:
- a reference to this, so the API can be used fluently
-
getKeepAliveTimeout
public int getKeepAliveTimeout()- Returns:
- the keep alive timeout value in seconds for HTTP/1.x connections
-
setKeepAliveTimeout
Set the keep alive timeout for HTTP/1.x, in seconds. This value determines how long a connection remains unused in the pool before being evicted and closed. A timeout of0means there is no timeout.- Parameters:
keepAliveTimeout- the timeout, in seconds- Returns:
- a reference to this, so the API can be used fluently
-
isPipelining
public boolean isPipelining()Is pipe-lining enabled on the client- Returns:
trueif pipe-lining is enabled
-
setPipelining
Set whether pipe-lining is enabled on the client- Parameters:
pipelining-trueif enabled- Returns:
- a reference to this, so the API can be used fluently
-
getPipeliningLimit
public int getPipeliningLimit()- Returns:
- the limit of pending requests a pipe-lined HTTP/1 connection can send
-
setPipeliningLimit
Set the limit of pending requests a pipe-lined HTTP/1 connection can send.- Parameters:
limit- the limit of pending requests- Returns:
- a reference to this, so the API can be used fluently
-
isVerifyHost
public boolean isVerifyHost()Is hostname verification (for SSL/TLS) enabled?- Returns:
trueif enabled
-
setVerifyHost
Set whether hostname verification is enabled- Parameters:
verifyHost-trueif enabled- Returns:
- a reference to this, so the API can be used fluently
-
isDecompressionSupported
public boolean isDecompressionSupported()- Returns:
trueif the client should send requests with anaccepting-encodingheader set to a compression algorithm,falseotherwise
-
setDecompressionSupported
Whether the client should send requests with anaccepting-encodingheader set to a compression algorithm.- Parameters:
decompressionSupported-trueif the client should send a request with anaccepting-encodingheader set to a compression algorithm,falseotherwise- Returns:
- a reference to this, so the API can be used fluently
-
getDefaultHost
Get the default host name to be used by this client in requests if none is provided when making the request.- Returns:
- the default host name
-
setDefaultHost
Set the default host name to be used by this client in requests if none is provided when making the request.- Returns:
- a reference to this, so the API can be used fluently
-
getDefaultPort
public int getDefaultPort()Get the default port to be used by this client in requests if none is provided when making the request.- Returns:
- the default port
-
setDefaultPort
Set the default port to be used by this client in requests if none is provided when making the request.- Returns:
- a reference to this, so the API can be used fluently
-
getProtocolVersion
-
setProtocolVersion
Set the protocol version.- Parameters:
protocolVersion- the protocol version- Returns:
- a reference to this, so the API can be used fluently
-
setMaxChunkSize
Set the maximum HTTP chunk size- Parameters:
maxChunkSize- the maximum chunk size- Returns:
- a reference to this, so the API can be used fluently
-
getMaxChunkSize
public int getMaxChunkSize()Returns the maximum HTTP chunk size- Returns:
- the maximum HTTP chunk size
-
getMaxInitialLineLength
public int getMaxInitialLineLength()- Returns:
- the maximum length of the initial line for HTTP/1.x (e.g.
"GET / HTTP/1.0")
-
setMaxInitialLineLength
Set the maximum length of the initial line for HTTP/1.x (e.g."HTTP/1.1 200 OK")- Parameters:
maxInitialLineLength- the new maximum initial length- Returns:
- a reference to this, so the API can be used fluently
-
getMaxHeaderSize
public int getMaxHeaderSize()- Returns:
- Returns the maximum length of all headers for HTTP/1.x
-
setMaxHeaderSize
Set the maximum length of all headers for HTTP/1.x .- Parameters:
maxHeaderSize- the new maximum length- Returns:
- a reference to this, so the API can be used fluently
-
getInitialSettings
- Returns:
- the initial HTTP/2 connection settings
-
setInitialSettings
Set the HTTP/2 connection settings immediately sent by to the server when the client connects.- Parameters:
settings- the settings value- Returns:
- a reference to this, so the API can be used fluently
-
setUseAlpn
Description copied from class:TCPSSLOptionsSet the ALPN usage.- Overrides:
setUseAlpnin classClientOptionsBase- Parameters:
useAlpn- true when Application-Layer Protocol Negotiation should be used
-
setSslEngineOptions
Description copied from class:TCPSSLOptionsSet to use SSL engine implementation to use.- Overrides:
setSslEngineOptionsin classClientOptionsBase- Parameters:
sslEngineOptions- the ssl engine to use- Returns:
- a reference to this, so the API can be used fluently
-
getAlpnVersions
- Returns:
- the list of protocol versions to provide during the Application-Layer Protocol Negotiation. When
the list is empty, the client provides a best effort list according to
setProtocolVersion(HttpVersion)
-
setAlpnVersions
Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation. When the list is empty, the client makes a best effort list according tosetProtocolVersion(HttpVersion):HttpVersion.HTTP_2: [ "h2", "http/1.1" ]- otherwise: [
getProtocolVersion()]
- Parameters:
alpnVersions- the versions- Returns:
- a reference to this, so the API can be used fluently
-
isHttp2ClearTextUpgrade
public boolean isHttp2ClearTextUpgrade()- Returns:
truewhen an h2c connection is established using an HTTP/1.1 upgrade request,falsewhen directly
-
setHttp2ClearTextUpgrade
Set totruewhen an h2c connection is established using an HTTP/1.1 upgrade request, andfalsewhen an h2c connection is established directly (with prior knowledge).- Parameters:
value- the upgrade value- Returns:
- a reference to this, so the API can be used fluently
-
isHttp2ClearTextUpgradeWithPreflightRequest
public boolean isHttp2ClearTextUpgradeWithPreflightRequest()- Returns:
truewhen an h2c connection established using an HTTP/1.1 upgrade request should perform a preflightOPTIONSrequest to the origin server to establish the h2c connection
-
setHttp2ClearTextUpgradeWithPreflightRequest
Set totruewhen an h2c connection established using an HTTP/1.1 upgrade request should perform a preflightOPTIONSrequest to the origin server to establish the h2c connection.- Parameters:
value- the upgrade value- Returns:
- a reference to this, so the API can be used fluently
-
getMaxRedirects
public int getMaxRedirects()- Returns:
- the maximum number of redirection a request can follow
-
setMaxRedirects
Set tomaxRedirectsthe maximum number of redirection a request can follow.- Parameters:
maxRedirects- the maximum number of redirection- Returns:
- a reference to this, so the API can be used fluently
-
isForceSni
public boolean isForceSni()- Returns:
- whether the client should always use SNI on TLS/SSL connections
-
setForceSni
By default, the server name is only sent for Fully Qualified Domain Name (FQDN), setting this property totrueforces the server name to be always sent.- Parameters:
forceSni-truewhen the client should always use SNI on TLS/SSL connections- Returns:
- a reference to this, so the API can be used fluently
-
setMetricsName
Description copied from class:ClientOptionsBaseSet the metrics name identifying the reported metrics, useful for grouping metrics with the same name.- Overrides:
setMetricsNamein classClientOptionsBase- Parameters:
metricsName- the metrics name- Returns:
- a reference to this, so the API can be used fluently
-
setProxyOptions
Description copied from class:ClientOptionsBaseSet proxy options for connections via CONNECT proxy (e.g. Squid) or a SOCKS proxy.- Overrides:
setProxyOptionsin classClientOptionsBase- Parameters:
proxyOptions- proxy options object- Returns:
- a reference to this, so the API can be used fluently
-
setNonProxyHosts
Description copied from class:ClientOptionsBaseSet a list of remote hosts that are not proxied when the client is configured to use a proxy. This list serves the same purpose than the JVMnonProxyHostsconfiguration.Entries can use the * wildcard character for pattern matching, e.g *.example.com matches www.example.com.
- Overrides:
setNonProxyHostsin classClientOptionsBase- Parameters:
nonProxyHosts- the list of non proxies hosts- Returns:
- a reference to this, so the API can be used fluently
-
addNonProxyHost
Description copied from class:ClientOptionsBaseAdd ahostto theClientOptionsBase.getNonProxyHosts()list.- Overrides:
addNonProxyHostin classClientOptionsBase- Parameters:
nonProxyHost- the added host- Returns:
- a reference to this, so the API can be used fluently
-
setLocalAddress
Description copied from class:ClientOptionsBaseSet the local interface to bind for network connections. When the local address is null, it will pick any local address, the default local address is null.- Overrides:
setLocalAddressin classClientOptionsBase- Parameters:
localAddress- the local address- Returns:
- a reference to this, so the API can be used fluently
-
setLogActivity
Description copied from class:NetworkOptionsSet to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.- Overrides:
setLogActivityin classClientOptionsBase- Parameters:
logEnabled- true for logging the network activity- Returns:
- a reference to this, so the API can be used fluently
-
setActivityLogDataFormat
Description copied from class:NetworkOptionsSet the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.- Overrides:
setActivityLogDataFormatin classClientOptionsBase- Parameters:
activityLogDataFormat- the format to use- Returns:
- a reference to this, so the API can be used fluently
-
getDecoderInitialBufferSize
public int getDecoderInitialBufferSize()- Returns:
- the initial buffer size for the HTTP decoder
-
setDecoderInitialBufferSize
set toinitialBufferSizeHttpDecoderthe initial buffer of the HttpDecoder.- Parameters:
decoderInitialBufferSize- the initial buffer size- Returns:
- a reference to this, so the API can be used fluently
-
getTracingPolicy
- Returns:
- the tracing policy
-
setTracingPolicy
Set the tracing policy for the client behavior when Vert.x has tracing enabled.- Parameters:
tracingPolicy- the tracing policy- Returns:
- a reference to this, so the API can be used fluently
-
getName
- Returns:
- the client name used for sharing
-
setName
Set the client name, used when the client is shared, otherwise ignored.- Parameters:
name- the new name- Returns:
- a reference to this, so the API can be used fluently
-
getFollowAlternativeServices
@Unstable public boolean getFollowAlternativeServices()- Returns:
- whether the client follows alternative services advertisements
-
setFollowAlternativeServices
Configure whether the client follows alternative services advertisements, the default setting does not.
Setting this to true, instructs the client to use most appropriate alternative services advertised by HTTP servers.
The client only follows alternative services it can trust for a given origin, in practice this means this only the
httpsscheme is supported and alternatives handshake uses the alternative origin.- Parameters:
followAlternativeServices- the config value
-