io.vertx.core.http

## 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

-     public class HttpClientOptions
      extends ClientOptionsBase

  Options describing how an `HttpClient` will make connections.
  Author:
    Tim Fox

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_DEFAULT_HOST` The default value for host name = "localhost"
    `static int` | `DEFAULT_DEFAULT_PORT` The default value for port = 80
    `static boolean` | `DEFAULT_KEEP_ALIVE` Default value of whether keep-alive is enabled = true
    `static int` | `DEFAULT_MAX_POOL_SIZE` The default maximum number of connections a client will pool = 5
    `static int` | `DEFAULT_MAX_WEBSOCKET_FRAME_SIZE` The default value for maximum websocket frame size = 65536 bytes
    `static boolean` | `DEFAULT_PIPELINING` Default value of whether pipe-lining is enabled = false
    `static HttpVersion` | `DEFAULT_PROTOCOL_VERSION` The default protocol version = HTTP/1.1
    `static boolean` | `DEFAULT_TRY_USE_COMPRESSION` Default value of whether the client will attempt to use compression = false
    `static boolean` | `DEFAULT_VERIFY_HOST` Default value of whether hostname verification (for SSL/TLS) is enabled = true

    - ### Fields inherited from class io.vertx.core.net.ClientOptionsBase

      `DEFAULT_CONNECT_TIMEOUT, DEFAULT_TRUST_ALL`

    - ### Fields inherited from class io.vertx.core.net.TCPSSLOptions

      `DEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_POOLED_BUFFERS`

    - ### Fields inherited from class io.vertx.core.net.NetworkOptions

      `DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpClientOptions()` Default constructor
    `HttpClientOptions(HttpClientOptions other)` Copy constructor
    `HttpClientOptions(JsonObject json)` Constructor to create an options from JSON

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `HttpClientOptions` | `addCrlPath(String crlPath)` Add a CRL path
    `HttpClientOptions` | `addCrlValue(Buffer crlValue)` Add a CRL value
    `HttpClientOptions` | `addEnabledCipherSuite(String suite)` Add an enabled cipher suite
    `boolean` | `equals(Object o)`
    `String` | `getDefaultHost()` Get the default host name to be used by this client in requests if none is provided when making the request.
    `int` | `getDefaultPort()` Get the default port to be used by this client in requests if none is provided when making the request.
    `int` | `getMaxPoolSize()` Get the maximum pool size for connections
    `int` | `getMaxWebsocketFrameSize()` Get the maximum websocket framesize to use
    `HttpVersion` | `getProtocolVersion()` Get the protocol version.
    `int` | `hashCode()`
    `boolean` | `isKeepAlive()` Is keep alive enabled on the client?
    `boolean` | `isPipelining()` Is pipe-lining enabled on the client
    `boolean` | `isTryUseCompression()` Is compression enabled on the client?
    `boolean` | `isVerifyHost()` Is hostname verification (for SSL/TLS) enabled?
    `HttpClientOptions` | `setConnectTimeout(int connectTimeout)` Set the connect timeout
    `HttpClientOptions` | `setDefaultHost(String defaultHost)` Set the default host name to be used by this client in requests if none is provided when making the request.
    `HttpClientOptions` | `setDefaultPort(int defaultPort)` Set the default port to be used by this client in requests if none is provided when making the request.
    `HttpClientOptions` | `setIdleTimeout(int idleTimeout)` Set the idle timeout, in seconds.
    `HttpClientOptions` | `setKeepAlive(boolean keepAlive)` Set whether keep alive is enabled on the client
    `HttpClientOptions` | `setKeyStoreOptions(JksOptions options)` Set the key/cert options in jks format, aka Java keystore.
    `HttpClientOptions` | `setMaxPoolSize(int maxPoolSize)` Set the maximum pool size for connections
    `HttpClientOptions` | `setMaxWebsocketFrameSize(int maxWebsocketFrameSize)` Set the max websocket frame size
    `HttpClientOptions` | `setPemKeyCertOptions(PemKeyCertOptions options)` Set the key/cert store options in pem format.
    `HttpClientOptions` | `setPemTrustOptions(PemTrustOptions options)` Set the trust options in pem format
    `HttpClientOptions` | `setPfxKeyCertOptions(PfxOptions options)` Set the key/cert options in pfx format.
    `HttpClientOptions` | `setPfxTrustOptions(PfxOptions options)` Set the trust options in pfx format
    `HttpClientOptions` | `setPipelining(boolean pipelining)` Set whether pipe-lining is enabled on the client
    `HttpClientOptions` | `setProtocolVersion(HttpVersion protocolVersion)` Set the protocol version.
    `HttpClientOptions` | `setReceiveBufferSize(int receiveBufferSize)` Set the TCP receive buffer size
    `HttpClientOptions` | `setReuseAddress(boolean reuseAddress)` Set the value of reuse address
    `HttpClientOptions` | `setSendBufferSize(int sendBufferSize)` Set the TCP send buffer size
    `HttpClientOptions` | `setSoLinger(int soLinger)` Set whether SO_linger keep alive is enabled
    `HttpClientOptions` | `setSsl(boolean ssl)` Set whether SSL/TLS is enabled
    `HttpClientOptions` | `setTcpKeepAlive(boolean tcpKeepAlive)` Set whether TCP keep alive is enabled
    `HttpClientOptions` | `setTcpNoDelay(boolean tcpNoDelay)` Set whether TCP no delay is enabled
    `HttpClientOptions` | `setTrafficClass(int trafficClass)` Set the value of traffic class
    `HttpClientOptions` | `setTrustAll(boolean trustAll)` Set whether all server certificates should be trusted
    `HttpClientOptions` | `setTrustStoreOptions(JksOptions options)` Set the trust options in jks format, aka Java trustore
    `HttpClientOptions` | `setTryUseCompression(boolean tryUseCompression)` Set whether compression is enabled
    `HttpClientOptions` | `setUsePooledBuffers(boolean usePooledBuffers)` Set whether Netty pooled buffers are enabled
    `HttpClientOptions` | `setVerifyHost(boolean verifyHost)` Set whether hostname verification is enabled

    - ### Methods inherited from class io.vertx.core.net.ClientOptionsBase

      `getConnectTimeout, isTrustAll`

    - ### Methods inherited from class io.vertx.core.net.TCPSSLOptions

      `getCrlPaths, getCrlValues, getEnabledCipherSuites, getIdleTimeout, getKeyCertOptions, getSoLinger, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUsePooledBuffers`

    - ### Methods inherited from class io.vertx.core.net.NetworkOptions

      `getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_MAX_POOL_SIZE

          public static final int DEFAULT_MAX_POOL_SIZE

      The default maximum number of connections a client will pool = 5
      See Also:
        Constant Field Values

    - #### DEFAULT_KEEP_ALIVE

          public static final boolean DEFAULT_KEEP_ALIVE

      Default value of whether keep-alive is enabled = true
      See Also:
        Constant Field Values

    - #### DEFAULT_PIPELINING

          public static final boolean DEFAULT_PIPELINING

      Default value of whether pipe-lining is enabled = false
      See Also:
        Constant Field Values

    - #### DEFAULT_TRY_USE_COMPRESSION

          public static final boolean DEFAULT_TRY_USE_COMPRESSION

      Default value of whether the client will attempt to use compression = false
      See Also:
        Constant Field Values

    - #### DEFAULT_VERIFY_HOST

          public static final boolean DEFAULT_VERIFY_HOST

      Default value of whether hostname verification (for SSL/TLS) is enabled = true
      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_WEBSOCKET_FRAME_SIZE

          public static final int DEFAULT_MAX_WEBSOCKET_FRAME_SIZE

      The default value for maximum websocket frame size = 65536 bytes
      See Also:
        Constant Field Values

    - #### DEFAULT_DEFAULT_HOST

          public static final String DEFAULT_DEFAULT_HOST

      The default value for host name = "localhost"
      See Also:
        Constant Field Values

    - #### DEFAULT_DEFAULT_PORT

          public static final int DEFAULT_DEFAULT_PORT

      The default value for port = 80
      See Also:
        Constant Field Values

    - #### DEFAULT_PROTOCOL_VERSION

          public static final HttpVersion DEFAULT_PROTOCOL_VERSION

      The default protocol version = HTTP/1.1

  - ### Constructor Detail

    - #### HttpClientOptions

          public HttpClientOptions()

      Default constructor

    - #### HttpClientOptions

          public HttpClientOptions(HttpClientOptions other)

      Copy constructor
      Parameters:
        `other` - the options to copy

    - #### HttpClientOptions

          public HttpClientOptions(JsonObject json)

      Constructor to create an options from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### setSendBufferSize

          public HttpClientOptions setSendBufferSize(int sendBufferSize)

      Description copied from class: `NetworkOptions`
      Set the TCP send buffer size
      Overrides:
        `setSendBufferSize` in class `NetworkOptions`
      Parameters:
        `sendBufferSize` - the buffers size, in bytes
      Returns:
        a reference to this, so the API can be used fluently

    - #### setReceiveBufferSize

          public HttpClientOptions setReceiveBufferSize(int receiveBufferSize)

      Description copied from class: `NetworkOptions`
      Set the TCP receive buffer size
      Overrides:
        `setReceiveBufferSize` in class `NetworkOptions`
      Parameters:
        `receiveBufferSize` - the buffers size, in bytes
      Returns:
        a reference to this, so the API can be used fluently

    - #### setReuseAddress

          public HttpClientOptions setReuseAddress(boolean reuseAddress)

      Description copied from class: `NetworkOptions`
      Set the value of reuse address
      Overrides:
        `setReuseAddress` in class `NetworkOptions`
      Parameters:
        `reuseAddress` - the value of reuse address
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrafficClass

          public HttpClientOptions setTrafficClass(int trafficClass)

      Description copied from class: `NetworkOptions`
      Set the value of traffic class
      Overrides:
        `setTrafficClass` in class `NetworkOptions`
      Parameters:
        `trafficClass` - the value of traffic class
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTcpNoDelay

          public HttpClientOptions setTcpNoDelay(boolean tcpNoDelay)

      Description copied from class: `TCPSSLOptions`
      Set whether TCP no delay is enabled
      Overrides:
        `setTcpNoDelay` in class `TCPSSLOptions`
      Parameters:
        `tcpNoDelay` - true if TCP no delay is enabled (Nagle disabled)
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTcpKeepAlive

          public HttpClientOptions setTcpKeepAlive(boolean tcpKeepAlive)

      Description copied from class: `TCPSSLOptions`
      Set whether TCP keep alive is enabled
      Overrides:
        `setTcpKeepAlive` in class `TCPSSLOptions`
      Parameters:
        `tcpKeepAlive` - true if TCP keep alive is enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSoLinger

          public HttpClientOptions setSoLinger(int soLinger)

      Description copied from class: `TCPSSLOptions`
      Set whether SO_linger keep alive is enabled
      Overrides:
        `setSoLinger` in class `TCPSSLOptions`
      Parameters:
        `soLinger` - true if SO_linger is enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setUsePooledBuffers

          public HttpClientOptions setUsePooledBuffers(boolean usePooledBuffers)

      Description copied from class: `TCPSSLOptions`
      Set whether Netty pooled buffers are enabled
      Overrides:
        `setUsePooledBuffers` in class `TCPSSLOptions`
      Parameters:
        `usePooledBuffers` - true if pooled buffers enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setIdleTimeout

          public HttpClientOptions setIdleTimeout(int idleTimeout)

      Description copied from class: `TCPSSLOptions`
      Set the idle timeout, in seconds. zero means don't timeout. This determines if a connection will timeout and be closed if no data is received within the timeout.
      Overrides:
        `setIdleTimeout` in class `TCPSSLOptions`
      Parameters:
        `idleTimeout` - the timeout, in seconds
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSsl

          public HttpClientOptions setSsl(boolean ssl)

      Description copied from class: `TCPSSLOptions`
      Set whether SSL/TLS is enabled
      Overrides:
        `setSsl` in class `TCPSSLOptions`
      Parameters:
        `ssl` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setKeyStoreOptions

          public HttpClientOptions setKeyStoreOptions(JksOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert options in jks format, aka Java keystore.
      Overrides:
        `setKeyStoreOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the key store in jks format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPfxKeyCertOptions

          public HttpClientOptions setPfxKeyCertOptions(PfxOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert options in pfx format.
      Overrides:
        `setPfxKeyCertOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the key cert options in pfx format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPemKeyCertOptions

          public HttpClientOptions setPemKeyCertOptions(PemKeyCertOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert store options in pem format.
      Overrides:
        `setPemKeyCertOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in pem format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrustStoreOptions

          public HttpClientOptions setTrustStoreOptions(JksOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in jks format, aka Java trustore
      Overrides:
        `setTrustStoreOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in jks format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPfxTrustOptions

          public HttpClientOptions setPfxTrustOptions(PfxOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in pfx format
      Overrides:
        `setPfxTrustOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in pfx format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPemTrustOptions

          public HttpClientOptions setPemTrustOptions(PemTrustOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in pem format
      Overrides:
        `setPemTrustOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in pem format
      Returns:
        a reference to this, so the API can be used fluently

    - #### addEnabledCipherSuite

          public HttpClientOptions addEnabledCipherSuite(String suite)

      Description copied from class: `TCPSSLOptions`
      Add an enabled cipher suite
      Overrides:
        `addEnabledCipherSuite` in class `TCPSSLOptions`
      Parameters:
        `suite` - the suite
      Returns:
        a reference to this, so the API can be used fluently

    - #### addCrlPath

          public HttpClientOptions addCrlPath(String crlPath)
                                       throws NullPointerException

      Description copied from class: `TCPSSLOptions`
      Add a CRL path
      Overrides:
        `addCrlPath` in class `TCPSSLOptions`
      Parameters:
        `crlPath` - the path
      Returns:
        a reference to this, so the API can be used fluently
      Throws:
        `NullPointerException`

    - #### addCrlValue

          public HttpClientOptions addCrlValue(Buffer crlValue)
                                        throws NullPointerException

      Description copied from class: `TCPSSLOptions`
      Add a CRL value
      Overrides:
        `addCrlValue` in class `TCPSSLOptions`
      Parameters:
        `crlValue` - the value
      Returns:
        a reference to this, so the API can be used fluently
      Throws:
        `NullPointerException`

    - #### setConnectTimeout

          public HttpClientOptions setConnectTimeout(int connectTimeout)

      Description copied from class: `ClientOptionsBase`
      Set the connect timeout
      Overrides:
        `setConnectTimeout` in class `ClientOptionsBase`
      Parameters:
        `connectTimeout` - connect timeout, in ms
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrustAll

          public HttpClientOptions setTrustAll(boolean trustAll)

      Description copied from class: `ClientOptionsBase`
      Set whether all server certificates should be trusted
      Overrides:
        `setTrustAll` in class `ClientOptionsBase`
      Parameters:
        `trustAll` - true if all should be trusted
      Returns:
        a reference to this, so the API can be used fluently

    - #### getMaxPoolSize

          public int getMaxPoolSize()

      Get the maximum pool size for connections
      Returns:
        the maximum pool size

    - #### setMaxPoolSize

          public HttpClientOptions setMaxPoolSize(int maxPoolSize)

      Set the maximum pool size for connections
      Parameters:
        `maxPoolSize` - the maximum pool size
      Returns:
        a reference to this, so the API can be used fluently

    - #### isKeepAlive

          public boolean isKeepAlive()

      Is keep alive enabled on the client?
      Returns:
        true if enabled

    - #### setKeepAlive

          public HttpClientOptions setKeepAlive(boolean keepAlive)

      Set whether keep alive is enabled on the client
      Parameters:
        `keepAlive` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### isPipelining

          public boolean isPipelining()

      Is pipe-lining enabled on the client
      Returns:
        true if pipe-lining is enabled

    - #### setPipelining

          public HttpClientOptions setPipelining(boolean pipelining)

      Set whether pipe-lining is enabled on the client
      Parameters:
        `pipelining` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### isVerifyHost

          public boolean isVerifyHost()

      Is hostname verification (for SSL/TLS) enabled?
      Returns:
        true if enabled

    - #### setVerifyHost

          public HttpClientOptions setVerifyHost(boolean verifyHost)

      Set whether hostname verification is enabled
      Parameters:
        `verifyHost` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### isTryUseCompression

          public boolean isTryUseCompression()

      Is compression enabled on the client?
      Returns:
        true if enabled

    - #### setTryUseCompression

          public HttpClientOptions setTryUseCompression(boolean tryUseCompression)

      Set whether compression is enabled
      Parameters:
        `tryUseCompression` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### getMaxWebsocketFrameSize

          public int getMaxWebsocketFrameSize()

      Get the maximum websocket framesize to use
      Returns:
        the max websocket framesize

    - #### setMaxWebsocketFrameSize

          public HttpClientOptions setMaxWebsocketFrameSize(int maxWebsocketFrameSize)

      Set the max websocket frame size
      Parameters:
        `maxWebsocketFrameSize` - the max frame size, in bytes
      Returns:
        a reference to this, so the API can be used fluently

    - #### getDefaultHost

          public String 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

          public HttpClientOptions setDefaultHost(String defaultHost)

      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

          public HttpClientOptions setDefaultPort(int defaultPort)

      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

          public HttpVersion getProtocolVersion()

      Get the protocol version.
      Returns:
        the protocol version

    - #### setProtocolVersion

          public HttpClientOptions setProtocolVersion(HttpVersion protocolVersion)

      Set the protocol version.
      Parameters:
        `protocolVersion` - the protocol version
      Returns:
        a reference to this, so the API can be used fluently

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `ClientOptionsBase`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `ClientOptionsBase`

Copyright © 2015. All rights reserved.