An asynchronous HTTP client.

It allows you to make requests to HTTP servers, and a single client can make requests to any server.

It also allows you to open WebSockets to servers.

The client can also pool HTTP connections.

For pooling to occur, keep-alive must be true on the HttpClientOptions (default is true). In this case connections will be pooled and re-used if there are pending HTTP requests waiting to get a connection, otherwise they will be closed.

This gives the benefits of keep alive when the client is loaded but means we don't keep connections hanging around unnecessarily when there would be no benefits anyway.

The client also supports pipe-lining of requests. Pipe-lining means another request is sent on the same connection before the response from the preceding one has returned. Pipe-lining is not appropriate for all requests.

To enable pipe-lining, it must be enabled on the HttpClientOptions (default is false).

When pipe-lining is enabled the connection will be automatically closed when all in-flight responses have returned and there are no outstanding pending requests to write.

The client is designed to be reused between requests.

no subtypes hierarchy

Initializer
HttpClient(HttpClient unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
closeshared default void close()

Close the client. Closing will close down any pooled connections. Clients should always be closed after use.

deleteshared default HttpClientRequest delete(RequestOptions options)

Create an HTTP DELETE request to send to the server with the specified options.

Parameters:
  • options

    the request options

deleteshared default HttpClientRequest delete(String requestURI)

Create an HTTP DELETE request to send to the server at the default host and port.

Parameters:
  • requestURI

    the relative URI

deleteshared default HttpClientRequest delete(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Create an HTTP DELETE request to send to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

deleteshared default HttpClientRequest delete(String host, String requestURI)

Create an HTTP DELETE request to send to the server at the specified host and default port.

Parameters:
  • host

    the host

  • requestURI

    the relative URI

deleteshared default HttpClientRequest delete(String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP DELETE request to send to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

deleteshared default HttpClientRequest delete(Integer port, String host, String requestURI)

Create an HTTP DELETE request to send to the server at the specified host and port.

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

deleteshared default HttpClientRequest delete(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP DELETE request to send to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

deleteshared default HttpClientRequest delete(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP DELETE request to send to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

deleteAbsshared default HttpClientRequest deleteAbs(String absoluteURI)

Create an HTTP DELETE request to send to the server using an absolute URI

Parameters:
  • absoluteURI

    the absolute URI

deleteAbsshared default HttpClientRequest deleteAbs(String absoluteURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response

Parameters:
  • absoluteURI

    the absolute URI

  • responseHandler

    the response handler

getshared default HttpClientRequest get(RequestOptions options)

Create an HTTP GET request to send to the server with the specified options.

Parameters:
  • options

    the request options

getshared default HttpClientRequest get(String requestURI)

Create an HTTP GET request to send to the server at the default host and port.

Parameters:
  • requestURI

    the relative URI

getshared default HttpClientRequest get(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Create an HTTP GET request to send to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

getshared default HttpClientRequest get(String host, String requestURI)

Create an HTTP GET request to send to the server at the specified host and default port.

Parameters:
  • host

    the host

  • requestURI

    the relative URI

getshared default HttpClientRequest get(String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP GET request to send to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

getshared default HttpClientRequest get(Integer port, String host, String requestURI)

Create an HTTP GET request to send to the server at the specified host and port.

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

getshared default HttpClientRequest get(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP GET request to send to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

getshared default HttpClientRequest get(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP GET request to send to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

getAbsshared default HttpClientRequest getAbs(String absoluteURI)

Create an HTTP GET request to send to the server using an absolute URI

Parameters:
  • absoluteURI

    the absolute URI

getAbsshared default HttpClientRequest getAbs(String absoluteURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response

Parameters:
  • absoluteURI

    the absolute URI

  • responseHandler

    the response handler

getNowshared default HttpClient getNow(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Sends an HTTP GET request to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

getNowshared default HttpClient getNow(String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP GET request to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

getNowshared default HttpClient getNow(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP GET request to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

getNowshared default HttpClient getNow(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP GET request to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

shared default HttpClientRequest head(RequestOptions options)

Create an HTTP HEAD request to send to the server with the specified options.

Parameters:
  • options

    the request options

headshared default HttpClientRequest head(String requestURI)

Create an HTTP HEAD request to send to the server at the default host and port.

Parameters:
  • requestURI

    the relative URI

headshared default HttpClientRequest head(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Create an HTTP HEAD request to send to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

headshared default HttpClientRequest head(String host, String requestURI)

Create an HTTP HEAD request to send to the server at the specified host and default port.

Parameters:
  • host

    the host

  • requestURI

    the relative URI

headshared default HttpClientRequest head(String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP HEAD request to send to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

headshared default HttpClientRequest head(Integer port, String host, String requestURI)

Create an HTTP HEAD request to send to the server at the specified host and port.

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

headshared default HttpClientRequest head(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP HEAD request to send to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

headshared default HttpClientRequest head(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP HEAD request to send to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

headAbsshared default HttpClientRequest headAbs(String absoluteURI)

Create an HTTP HEAD request to send to the server using an absolute URI

Parameters:
  • absoluteURI

    the absolute URI

headAbsshared default HttpClientRequest headAbs(String absoluteURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response

Parameters:
  • absoluteURI

    the absolute URI

  • responseHandler

    the response handler

headNowshared default HttpClient headNow(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Sends an HTTP HEAD request to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

headNowshared default HttpClient headNow(String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP HEAD request to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

headNowshared default HttpClient headNow(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP HEAD request to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

headNowshared default HttpClient headNow(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP HEAD request to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

isMetricsEnabledshared actual default Boolean isMetricsEnabled()

Whether the metrics are enabled for this measured object

optionsshared default HttpClientRequest options(RequestOptions options)

Create an HTTP OPTIONS request to send to the server with the specified options.

Parameters:
  • options

    the request options

optionsshared default HttpClientRequest options(String requestURI)

Create an HTTP OPTIONS request to send to the server at the default host and port.

Parameters:
  • requestURI

    the relative URI

optionsshared default HttpClientRequest options(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Create an HTTP OPTIONS request to send to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

optionsshared default HttpClientRequest options(String host, String requestURI)

Create an HTTP OPTIONS request to send to the server at the specified host and default port.

Parameters:
  • host

    the host

  • requestURI

    the relative URI

optionsshared default HttpClientRequest options(String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP OPTIONS request to send to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

optionsshared default HttpClientRequest options(Integer port, String host, String requestURI)

Create an HTTP OPTIONS request to send to the server at the specified host and port.

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

optionsshared default HttpClientRequest options(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP OPTIONS request to send to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

optionsshared default HttpClientRequest options(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP OPTIONS request to send to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

optionsAbsshared default HttpClientRequest optionsAbs(String absoluteURI)

Create an HTTP OPTIONS request to send to the server using an absolute URI

Parameters:
  • absoluteURI

    the absolute URI

optionsAbsshared default HttpClientRequest optionsAbs(String absoluteURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP OPTIONS request to send to the server using an absolute URI, specifying a response handler to receive the response

Parameters:
  • absoluteURI

    the absolute URI

  • responseHandler

    the response handler

optionsNowshared default HttpClient optionsNow(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Sends an HTTP OPTIONS request to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

optionsNowshared default HttpClient optionsNow(String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP OPTIONS request to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

optionsNowshared default HttpClient optionsNow(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP OPTIONS request to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

optionsNowshared default HttpClient optionsNow(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Sends an HTTP OPTIONS request to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

postshared default HttpClientRequest post(RequestOptions options)

Create an HTTP POST request to send to the server with the specified options.

Parameters:
  • options

    the request options

postshared default HttpClientRequest post(String requestURI)

Create an HTTP POST request to send to the server at the default host and port.

Parameters:
  • requestURI

    the relative URI

postshared default HttpClientRequest post(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Create an HTTP POST request to send to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

postshared default HttpClientRequest post(String host, String requestURI)

Create an HTTP POST request to send to the server at the specified host and default port.

Parameters:
  • host

    the host

  • requestURI

    the relative URI

postshared default HttpClientRequest post(String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP POST request to send to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

postshared default HttpClientRequest post(Integer port, String host, String requestURI)

Create an HTTP POST request to send to the server at the specified host and port.

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

postshared default HttpClientRequest post(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP POST request to send to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

postshared default HttpClientRequest post(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP POST request to send to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

postAbsshared default HttpClientRequest postAbs(String absoluteURI)

Create an HTTP POST request to send to the server using an absolute URI

Parameters:
  • absoluteURI

    the absolute URI

postAbsshared default HttpClientRequest postAbs(String absoluteURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response

Parameters:
  • absoluteURI

    the absolute URI

  • responseHandler

    the response handler

putshared default HttpClientRequest put(RequestOptions options)

Create an HTTP PUT request to send to the server with the specified options.

Parameters:
  • options

    the request options

putshared default HttpClientRequest put(String requestURI)

Create an HTTP PUT request to send to the server at the default host and port.

Parameters:
  • requestURI

    the relative URI

putshared default HttpClientRequest put(RequestOptions options, Anything(HttpClientResponse) responseHandler)

Create an HTTP PUT request to send to the server with the specified options, specifying a response handler to receive the response

Parameters:
  • options

    the request options

  • responseHandler

    the response handler

putshared default HttpClientRequest put(String host, String requestURI)

Create an HTTP PUT request to send to the server at the specified host and default port.

Parameters:
  • host

    the host

  • requestURI

    the relative URI

putshared default HttpClientRequest put(String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP PUT request to send to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • requestURI

    the relative URI

  • responseHandler

    the response handler

putshared default HttpClientRequest put(Integer port, String host, String requestURI)

Create an HTTP PUT request to send to the server at the specified host and port.

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

putshared default HttpClientRequest put(String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP PUT request to send to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

putshared default HttpClientRequest put(Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP PUT request to send to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

putAbsshared default HttpClientRequest putAbs(String absoluteURI)

Create an HTTP PUT request to send to the server using an absolute URI

Parameters:
  • absoluteURI

    the absolute URI

putAbsshared default HttpClientRequest putAbs(String absoluteURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response

Parameters:
  • absoluteURI

    the absolute URI

  • responseHandler

    the response handler

redirectHandlershared default HttpClient redirectHandler(Future<HttpClientRequest>(HttpClientResponse) handler)

Set a redirect handler for the http client.

The redirect handler is called when a 3xx response is received and the request is configured to follow redirects with setFollowRedirects.

The redirect handler is passed the HttpClientResponse, it can return an HttpClientRequest or null.

  • when null is returned, the original response is processed by the original request response handler
  • when a new Future is returned, the client will send this new request

The handler must return a Future unsent so the client can further configure it and send it.

Parameters:
  • handler

    the new redirect handler

requestshared default HttpClientRequest request(HttpMethod method, RequestOptions options)

Create an HTTP request to send to the server with the specified options.

Parameters:
  • method

    the HTTP method

  • options

    the request options

requestshared default HttpClientRequest request(HttpMethod method, String requestURI)

Create an HTTP request to send to the server at the default host and port.

Parameters:
  • method

    the HTTP method

  • requestURI

    the relative URI

requestshared default HttpClientRequest request(HttpMethod method, RequestOptions options, Anything(HttpClientResponse) responseHandler)

Create an HTTP request to send to the server with the specified options, specifying a response handler to receive

Parameters:
  • method

    the HTTP method

  • options

    the request options

requestshared default HttpClientRequest request(HttpMethod method, String host, String requestURI)

Create an HTTP request to send to the server at the specified host and default port.

Parameters:
  • method

    the HTTP method

  • host

    the host

  • requestURI

    the relative URI

requestshared default HttpClientRequest request(HttpMethod method, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP request to send to the server at the default host and port, specifying a response handler to receive the response

Parameters:
  • method

    the HTTP method

  • requestURI

    the relative URI

  • responseHandler

    the response handler

requestshared default HttpClientRequest request(HttpMethod method, Integer port, String host, String requestURI)

Create an HTTP request to send to the server at the specified host and port.

Parameters:
  • method

    the HTTP method

  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

requestshared default HttpClientRequest request(HttpMethod method, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP request to send to the server at the specified host and default port, specifying a response handler to receive the response

Parameters:
  • method

    the HTTP method

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

requestshared default HttpClientRequest request(HttpMethod method, Integer port, String host, String requestURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP request to send to the server at the specified host and port, specifying a response handler to receive the response

Parameters:
  • method

    the HTTP method

  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • responseHandler

    the response handler

requestAbsshared default HttpClientRequest requestAbs(HttpMethod method, String absoluteURI)

Create an HTTP request to send to the server using an absolute URI

Parameters:
  • method

    the HTTP method

  • absoluteURI

    the absolute URI

requestAbsshared default HttpClientRequest requestAbs(HttpMethod method, String absoluteURI, Anything(HttpClientResponse) responseHandler)

Create an HTTP request to send to the server using an absolute URI, specifying a response handler to receive the response

Parameters:
  • method

    the HTTP method

  • absoluteURI

    the absolute URI

  • responseHandler

    the response handler

websocketshared default HttpClient websocket(RequestOptions options, Anything(WebSocket) wsConnect)

Connect a WebSocket with the specified options

Parameters:
  • options

    the request options

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String requestURI, Anything(WebSocket) wsConnect)

Connect a WebSocket at the relative request URI using the default host and port

Parameters:
  • requestURI

    the relative URI

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(RequestOptions options, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket with the specified options

Parameters:
  • options

    the request options

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(RequestOptions options, MultiMap headers, Anything(WebSocket) wsConnect)

Connect a WebSocket with the specified options, and with the specified headers

Parameters:
  • options

    the request options

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String host, String requestURI, Anything(WebSocket) wsConnect)

Connect a WebSocket to the host and relative request URI and default port

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String requestURI, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket at the relative request URI using the default host and port

Parameters:
  • requestURI

    the relative URI

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(String requestURI, MultiMap headers, Anything(WebSocket) wsConnect)

Connect a WebSocket at the relative request URI using the default host and port and the specified headers

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, Anything(WebSocket) wsConnect)

Connect a WebSocket to the specified port, host and relative request URI

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(RequestOptions options, MultiMap headers, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket with the specified options, and with the specified headers

Parameters:
  • options

    the request options

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect)

Connect a WebSocket with the specified optionsI, with the specified headers and using the specified version of WebSockets

Parameters:
  • options

    the request options

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String host, String requestURI, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the host and relative request URI and default port

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(String host, String requestURI, MultiMap headers, Anything(WebSocket) wsConnect)

Connect a WebSocket to the specified host,relative request UR, and default port and with the specified headers

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String requestURI, MultiMap headers, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket at the relative request URI using the default host and port and the specified headers

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers and the specified version of WebSockets

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the specified port, host and relative request URI

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, MultiMap headers, Anything(WebSocket) wsConnect)

Connect a WebSocket to the specified port, host and relative request URI, and with the specified headers

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket with the specified options, with the specified headers and using the specified version of WebSockets

Parameters:
  • options

    the request options

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect)

Connect a WebSocket with the specified options, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • options

    the request options

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String host, String requestURI, MultiMap headers, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the specified host,relative request UR, and default port and with the specified headers

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect)

Connect a WebSocket to the specified host, relative request URI and default port with the specified headers and using the specified version of WebSockets

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers and the specified version of WebSockets

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers, the specified version of WebSockets and the specified sub protocols

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, MultiMap headers, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, and with the specified headers

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers and using the specified version of WebSockets

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket with the specified options, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • options

    the request options

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the specified host, relative request URI and default port with the specified headers and using the specified version of WebSockets

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect)

Connect a WebSocket to the specified host, relative request URI and default port, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers, the specified version of WebSockets and the specified sub protocols

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, MultiMap headers, WebsocketVersion version, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers and using the specified version of WebSockets

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

  • wsConnect

    handler that will be called with the websocket when connected

websocketshared default HttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the specified host, relative request URI and default port, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketshared default HttpClient websocket(Integer port, String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketAbsshared default HttpClient websocketAbs(String url, MultiMap headers, WebsocketVersion version, String subProtocols, Anything(WebSocket) wsConnect, Anything(Throwable) failureHandler)

Connect a WebSocket with the specified absolute url, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols.

Parameters:
  • url

    the absolute url

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

  • wsConnect

    handler that will be called with the websocket when connected

  • failureHandler

    handler that will be called if websocket connection fails

websocketStreamshared default ReadStream<WebSocket> websocketStream(RequestOptions options)

Create a WebSocket stream with the specified options

Parameters:
  • options

    the request options

websocketStreamshared default ReadStream<WebSocket> websocketStream(String requestURI)

Create a WebSocket stream at the relative request URI using the default host and port and the specified headers

Parameters:
  • requestURI

    the relative URI

websocketStreamshared default ReadStream<WebSocket> websocketStream(RequestOptions options, MultiMap headers)

Create a WebSocket stream with the specified options, and with the specified headers

Parameters:
  • options

    the request options

  • headers

    the headers

websocketStreamshared default ReadStream<WebSocket> websocketStream(String host, String requestURI)

Create a WebSocket stream to the specified host, relative request URI and default port

Parameters:
  • host

    the host

  • requestURI

    the relative URI

websocketStreamshared default ReadStream<WebSocket> websocketStream(String requestURI, MultiMap headers)

Create a WebSocket stream at the relative request URI using the default host and port and the specified headers

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

websocketStreamshared default ReadStream<WebSocket> websocketStream(Integer port, String host, String requestURI)

Create a WebSocket stream to the specified port, host and relative request URI

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

websocketStreamshared default ReadStream<WebSocket> websocketStream(RequestOptions options, MultiMap headers, WebsocketVersion version)

Create a WebSocket stream with the specified options, with the specified headers and using the specified version of WebSockets

Parameters:
  • options

    the request options

  • headers

    the headers

  • version

    the websocket version

websocketStreamshared default ReadStream<WebSocket> websocketStream(String host, String requestURI, MultiMap headers)

Create a WebSocket stream to the specified host, relative request URI and default port and with the specified headers

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

websocketStreamshared default ReadStream<WebSocket> websocketStream(String requestURI, MultiMap headers, WebsocketVersion version)

Create a WebSocket stream at the relative request URI using the default host and port, the specified headers and the specified version of WebSockets

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

websocketStreamshared default ReadStream<WebSocket> websocketStream(Integer port, String host, String requestURI, MultiMap headers)

Create a WebSocket stream to the specified port, host and relative request URI, and with the specified headers

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

websocketStreamshared default ReadStream<WebSocket> websocketStream(RequestOptions options, MultiMap headers, WebsocketVersion version, String subProtocols)

Create a WebSocket stream to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • options

    the request options

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

websocketStreamshared default ReadStream<WebSocket> websocketStream(String host, String requestURI, MultiMap headers, WebsocketVersion version)

Create a WebSocket stream with the specified options and with the specified headers and using the specified version of WebSockets

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

websocketStreamshared default ReadStream<WebSocket> websocketStream(String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols)

Create a WebSocket stream at the relative request URI using the default host and port, the specified headers, the specified version of WebSockets and the specified sub protocols

Parameters:
  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols

websocketStreamshared default ReadStream<WebSocket> websocketStream(Integer port, String host, String requestURI, MultiMap headers, WebsocketVersion version)

Create a WebSocket stream to the specified port, host and relative request URI, with the specified headers and using the specified version of WebSockets

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

websocketStreamshared default ReadStream<WebSocket> websocketStream(String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols)

Create a WebSocket stream to the specified host, relative request URI and default port, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

websocketStreamshared default ReadStream<WebSocket> websocketStream(Integer port, String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols)

Create a WebSocket stream to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

Parameters:
  • port

    the port

  • host

    the host

  • requestURI

    the relative URI

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

websocketStreamAbsshared default ReadStream<WebSocket> websocketStreamAbs(String url, MultiMap headers, WebsocketVersion version, String subProtocols)

Create a WebSocket stream with the specified absolute url, the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols.

Parameters:
  • url

    the absolute url

  • headers

    the headers

  • version

    the websocket version

  • subProtocols

    the subprotocols to use

Inherited Methods
Methods inherited from: Object
equals
Methods inherited from: Measured