public interface HttpClient extends Measured
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.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the client.
|
HttpClientRequest |
delete(int port,
String host,
String requestURI)
Create an HTTP DELETE request to send to the server at the specified host and port.
|
HttpClientRequest |
delete(int port,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
delete(RequestOptions options)
Create an HTTP DELETE request to send to the server with the specified options.
|
HttpClientRequest |
delete(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Create an HTTP DELETE request to send to the server with the specified options, specifying a response handler to receive
the response
|
HttpClientRequest |
delete(String requestURI)
Create an HTTP DELETE request to send to the server at the default host and port.
|
HttpClientRequest |
delete(String requestURI,
Handler<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
|
HttpClientRequest |
delete(String host,
String requestURI)
Create an HTTP DELETE request to send to the server at the specified host and default port.
|
HttpClientRequest |
delete(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
deleteAbs(String absoluteURI)
Create an HTTP DELETE request to send to the server using an absolute URI
|
HttpClientRequest |
deleteAbs(String absoluteURI,
Handler<HttpClientResponse> responseHandler)
Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpClientRequest |
get(int port,
String host,
String requestURI)
Create an HTTP GET request to send to the server at the specified host and port.
|
HttpClientRequest |
get(int port,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
get(RequestOptions options)
Create an HTTP GET request to send to the server with the specified options.
|
HttpClientRequest |
get(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Create an HTTP GET request to send to the server with the specified options, specifying a response handler to receive
the response
|
HttpClientRequest |
get(String requestURI)
Create an HTTP GET request to send to the server at the default host and port.
|
HttpClientRequest |
get(String requestURI,
Handler<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
|
HttpClientRequest |
get(String host,
String requestURI)
Create an HTTP GET request to send to the server at the specified host and default port.
|
HttpClientRequest |
get(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
getAbs(String absoluteURI)
Create an HTTP GET request to send to the server using an absolute URI
|
HttpClientRequest |
getAbs(String absoluteURI,
Handler<HttpClientResponse> responseHandler)
Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpClient |
getNow(int port,
String host,
String requestURI,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP GET request to the server at the specified host and port, specifying a response handler to receive
the response
|
HttpClient |
getNow(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP GET request to the server with the specified options, specifying a response handler to receive
the response
|
HttpClient |
getNow(String requestURI,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP GET request to the server at the default host and port, specifying a response handler to receive
the response
|
HttpClient |
getNow(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
head(int port,
String host,
String requestURI)
Create an HTTP HEAD request to send to the server at the specified host and port.
|
HttpClientRequest |
head(int port,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
head(RequestOptions options)
Create an HTTP HEAD request to send to the server with the specified options.
|
HttpClientRequest |
head(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Create an HTTP HEAD request to send to the server with the specified options, specifying a response handler to receive
the response
|
HttpClientRequest |
head(String requestURI)
Create an HTTP HEAD request to send to the server at the default host and port.
|
HttpClientRequest |
head(String requestURI,
Handler<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
|
HttpClientRequest |
head(String host,
String requestURI)
Create an HTTP HEAD request to send to the server at the specified host and default port.
|
HttpClientRequest |
head(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
headAbs(String absoluteURI)
Create an HTTP HEAD request to send to the server using an absolute URI
|
HttpClientRequest |
headAbs(String absoluteURI,
Handler<HttpClientResponse> responseHandler)
Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpClient |
headNow(int port,
String host,
String requestURI,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP HEAD request to the server at the specified host and port, specifying a response handler to receive
the response
|
HttpClient |
headNow(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP HEAD request to the server with the specified options, specifying a response handler to receive
the response
|
HttpClient |
headNow(String requestURI,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP HEAD request to the server at the default host and port, specifying a response handler to receive
the response
|
HttpClient |
headNow(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
options(int port,
String host,
String requestURI)
Create an HTTP OPTIONS request to send to the server at the specified host and port.
|
HttpClientRequest |
options(int port,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
options(RequestOptions options)
Create an HTTP OPTIONS request to send to the server with the specified options.
|
HttpClientRequest |
options(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Create an HTTP OPTIONS request to send to the server with the specified options, specifying a response handler to receive
the response
|
HttpClientRequest |
options(String requestURI)
Create an HTTP OPTIONS request to send to the server at the default host and port.
|
HttpClientRequest |
options(String requestURI,
Handler<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
|
HttpClientRequest |
options(String host,
String requestURI)
Create an HTTP OPTIONS request to send to the server at the specified host and default port.
|
HttpClientRequest |
options(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
optionsAbs(String absoluteURI)
Create an HTTP OPTIONS request to send to the server using an absolute URI
|
HttpClientRequest |
optionsAbs(String absoluteURI,
Handler<HttpClientResponse> responseHandler)
Create an HTTP OPTIONS request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpClient |
optionsNow(int port,
String host,
String requestURI,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP OPTIONS request to the server at the specified host and port, specifying a response handler to receive
the response
|
HttpClient |
optionsNow(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP OPTIONS request to the server with the specified options, specifying a response handler to receive
the response
|
HttpClient |
optionsNow(String requestURI,
Handler<HttpClientResponse> responseHandler)
Sends an HTTP OPTIONS request to the server at the default host and port, specifying a response handler to receive
the response
|
HttpClient |
optionsNow(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
post(int port,
String host,
String requestURI)
Create an HTTP POST request to send to the server at the specified host and port.
|
HttpClientRequest |
post(int port,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
post(RequestOptions options)
Create an HTTP POST request to send to the server with the specified options.
|
HttpClientRequest |
post(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Create an HTTP POST request to send to the server with the specified options, specifying a response handler to receive
the response
|
HttpClientRequest |
post(String requestURI)
Create an HTTP POST request to send to the server at the default host and port.
|
HttpClientRequest |
post(String requestURI,
Handler<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
|
HttpClientRequest |
post(String host,
String requestURI)
Create an HTTP POST request to send to the server at the specified host and default port.
|
HttpClientRequest |
post(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
postAbs(String absoluteURI)
Create an HTTP POST request to send to the server using an absolute URI
|
HttpClientRequest |
postAbs(String absoluteURI,
Handler<HttpClientResponse> responseHandler)
Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpClientRequest |
put(int port,
String host,
String requestURI)
Create an HTTP PUT request to send to the server at the specified host and port.
|
HttpClientRequest |
put(int port,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
put(RequestOptions options)
Create an HTTP PUT request to send to the server with the specified options.
|
HttpClientRequest |
put(RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Create an HTTP PUT request to send to the server with the specified options, specifying a response handler to receive
the response
|
HttpClientRequest |
put(String requestURI)
Create an HTTP PUT request to send to the server at the default host and port.
|
HttpClientRequest |
put(String requestURI,
Handler<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
|
HttpClientRequest |
put(String host,
String requestURI)
Create an HTTP PUT request to send to the server at the specified host and default port.
|
HttpClientRequest |
put(String host,
String requestURI,
Handler<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
|
HttpClientRequest |
putAbs(String absoluteURI)
Create an HTTP PUT request to send to the server using an absolute URI
|
HttpClientRequest |
putAbs(String absoluteURI,
Handler<HttpClientResponse> responseHandler)
Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
Function<HttpClientResponse,Future<HttpClientRequest>> |
redirectHandler() |
HttpClient |
redirectHandler(Function<HttpClientResponse,Future<HttpClientRequest>> handler)
Set a redirect handler for the http client.
|
HttpClientRequest |
request(HttpMethod method,
int port,
String host,
String requestURI)
Create an HTTP request to send to the server at the specified host and port.
|
HttpClientRequest |
request(HttpMethod method,
int port,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
request(HttpMethod method,
RequestOptions options)
Create an HTTP request to send to the server with the specified options.
|
HttpClientRequest |
request(HttpMethod method,
RequestOptions options,
Handler<HttpClientResponse> responseHandler)
Create an HTTP request to send to the server with the specified options, specifying a response handler to receive
|
HttpClientRequest |
request(HttpMethod method,
String requestURI)
Create an HTTP request to send to the server at the default host and port.
|
HttpClientRequest |
request(HttpMethod method,
String requestURI,
Handler<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
|
HttpClientRequest |
request(HttpMethod method,
String host,
String requestURI)
Create an HTTP request to send to the server at the specified host and default port.
|
HttpClientRequest |
request(HttpMethod method,
String host,
String requestURI,
Handler<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
|
HttpClientRequest |
requestAbs(HttpMethod method,
String absoluteURI)
Create an HTTP request to send to the server using an absolute URI
|
HttpClientRequest |
requestAbs(HttpMethod method,
String absoluteURI,
Handler<HttpClientResponse> responseHandler)
Create an HTTP request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpClient |
websocket(int port,
String host,
String requestURI,
Handler<WebSocket> wsConnect)
Connect a WebSocket to the specified port, host and relative request URI
|
HttpClient |
websocket(int port,
String host,
String requestURI,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket to the specified port, host and relative request URI
|
HttpClient |
websocket(int port,
String host,
String requestURI,
MultiMap headers,
Handler<WebSocket> wsConnect)
Connect a WebSocket to the specified port, host and relative request URI, and with the specified headers
|
HttpClient |
websocket(int port,
String host,
String requestURI,
MultiMap headers,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket to the specified port, host and relative request URI, and with the specified headers
|
HttpClient |
websocket(int port,
String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
Handler<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
|
HttpClient |
websocket(int port,
String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
Handler<WebSocket> wsConnect,
Handler<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
|
HttpClient |
websocket(int port,
String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<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
|
HttpClient |
websocket(int port,
String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<WebSocket> wsConnect,
Handler<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
|
HttpClient |
websocket(RequestOptions options,
Handler<WebSocket> wsConnect)
Connect a WebSocket with the specified options
|
HttpClient |
websocket(RequestOptions options,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket with the specified options
|
HttpClient |
websocket(RequestOptions options,
MultiMap headers,
Handler<WebSocket> wsConnect)
Connect a WebSocket with the specified options, and with the specified headers
|
HttpClient |
websocket(RequestOptions options,
MultiMap headers,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket with the specified options, and with the specified headers
|
HttpClient |
websocket(RequestOptions options,
MultiMap headers,
WebsocketVersion version,
Handler<WebSocket> wsConnect)
Connect a WebSocket with the specified optionsI, with the specified headers and using
the specified version of WebSockets
|
HttpClient |
websocket(RequestOptions options,
MultiMap headers,
WebsocketVersion version,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket with the specified options, with the specified headers and using
the specified version of WebSockets
|
HttpClient |
websocket(RequestOptions options,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<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
|
HttpClient |
websocket(RequestOptions options,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<WebSocket> wsConnect,
Handler<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
|
HttpClient |
websocket(String requestURI,
Handler<WebSocket> wsConnect)
Connect a WebSocket at the relative request URI using the default host and port
|
HttpClient |
websocket(String requestURI,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket at the relative request URI using the default host and port
|
HttpClient |
websocket(String requestURI,
MultiMap headers,
Handler<WebSocket> wsConnect)
Connect a WebSocket at the relative request URI using the default host and port and the specified headers
|
HttpClient |
websocket(String requestURI,
MultiMap headers,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket at the relative request URI using the default host and port and the specified headers
|
HttpClient |
websocket(String requestURI,
MultiMap headers,
WebsocketVersion version,
Handler<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
|
HttpClient |
websocket(String requestURI,
MultiMap headers,
WebsocketVersion version,
Handler<WebSocket> wsConnect,
Handler<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
|
HttpClient |
websocket(String requestURI,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<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
|
HttpClient |
websocket(String requestURI,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<WebSocket> wsConnect,
Handler<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
|
HttpClient |
websocket(String host,
String requestURI,
Handler<WebSocket> wsConnect)
Connect a WebSocket to the host and relative request URI and default port
|
HttpClient |
websocket(String host,
String requestURI,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket to the host and relative request URI and default port
|
HttpClient |
websocket(String host,
String requestURI,
MultiMap headers,
Handler<WebSocket> wsConnect)
Connect a WebSocket to the specified host,relative request UR, and default port and with the specified headers
|
HttpClient |
websocket(String host,
String requestURI,
MultiMap headers,
Handler<WebSocket> wsConnect,
Handler<Throwable> failureHandler)
Connect a WebSocket to the specified host,relative request UR, and default port and with the specified headers
|
HttpClient |
websocket(String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
Handler<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
|
HttpClient |
websocket(String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
Handler<WebSocket> wsConnect,
Handler<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
|
HttpClient |
websocket(String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<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
|
HttpClient |
websocket(String host,
String requestURI,
MultiMap headers,
WebsocketVersion version,
String subProtocols,
Handler<WebSocket> wsConnect,
Handler<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
|
ReadStream<WebSocket> |
websocketStream(int port,
String host,
String requestURI)
Create a WebSocket stream to the specified port, host and relative request URI
|
ReadStream<WebSocket> |
websocketStream(int 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
|
ReadStream<WebSocket> |
websocketStream(int 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
|
ReadStream<WebSocket> |
websocketStream(int 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
|
ReadStream<WebSocket> |
websocketStream(RequestOptions options)
Create a WebSocket stream with the specified options
|
ReadStream<WebSocket> |
websocketStream(RequestOptions options,
MultiMap headers)
Create a WebSocket stream with the specified options, and with the specified headers
|
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
|
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
|
ReadStream<WebSocket> |
websocketStream(String requestURI)
Create a WebSocket stream at the relative request URI using the default host and port and the specified headers
|
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
|
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
|
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
|
ReadStream<WebSocket> |
websocketStream(String host,
String requestURI)
Create a WebSocket stream to the specified host, relative request URI and default port
|
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
|
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
|
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
|
isMetricsEnabled
HttpClientRequest request(HttpMethod method, RequestOptions options)
method
- the HTTP methodoptions
- the request optionsHttpClientRequest request(HttpMethod method, int port, String host, String requestURI)
method
- the HTTP methodport
- the porthost
- the hostrequestURI
- the relative URIHttpClientRequest request(HttpMethod method, String host, String requestURI)
method
- the HTTP methodhost
- the hostrequestURI
- the relative URIHttpClientRequest request(HttpMethod method, RequestOptions options, Handler<HttpClientResponse> responseHandler)
method
- the HTTP methodoptions
- the request optionsHttpClientRequest request(HttpMethod method, int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
method
- the HTTP methodport
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest request(HttpMethod method, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
method
- the HTTP methodhost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest request(HttpMethod method, String requestURI)
method
- the HTTP methodrequestURI
- the relative URIHttpClientRequest request(HttpMethod method, String requestURI, Handler<HttpClientResponse> responseHandler)
method
- the HTTP methodrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest requestAbs(HttpMethod method, String absoluteURI)
method
- the HTTP methodabsoluteURI
- the absolute URIHttpClientRequest requestAbs(HttpMethod method, String absoluteURI, Handler<HttpClientResponse> responseHandler)
method
- the HTTP methodabsoluteURI
- the absolute URIresponseHandler
- the response handlerHttpClientRequest get(RequestOptions options)
options
- the request optionsHttpClientRequest get(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpClientRequest get(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpClientRequest get(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClientRequest get(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest get(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest get(String requestURI)
requestURI
- the relative URIHttpClientRequest get(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest getAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpClientRequest getAbs(String absoluteURI, Handler<HttpClientResponse> responseHandler)
absoluteURI
- the absolute URIresponseHandler
- the response handlerHttpClient getNow(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClient getNow(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClient getNow(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClient getNow(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest post(RequestOptions options)
options
- the request optionsHttpClientRequest post(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpClientRequest post(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpClientRequest post(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClientRequest post(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest post(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest post(String requestURI)
requestURI
- the relative URIHttpClientRequest post(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest postAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpClientRequest postAbs(String absoluteURI, Handler<HttpClientResponse> responseHandler)
absoluteURI
- the absolute URIresponseHandler
- the response handlerHttpClientRequest head(RequestOptions options)
options
- the request optionsHttpClientRequest head(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpClientRequest head(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpClientRequest head(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClientRequest head(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest head(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest head(String requestURI)
requestURI
- the relative URIHttpClientRequest head(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest headAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpClientRequest headAbs(String absoluteURI, Handler<HttpClientResponse> responseHandler)
absoluteURI
- the absolute URIresponseHandler
- the response handlerHttpClient headNow(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClient headNow(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClient headNow(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClient headNow(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest options(RequestOptions options)
options
- the request optionsHttpClientRequest options(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpClientRequest options(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpClientRequest options(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClientRequest options(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest options(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest options(String requestURI)
requestURI
- the relative URIHttpClientRequest options(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest optionsAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpClientRequest optionsAbs(String absoluteURI, Handler<HttpClientResponse> responseHandler)
absoluteURI
- the absolute URIresponseHandler
- the response handlerHttpClient optionsNow(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClient optionsNow(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClient optionsNow(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClient optionsNow(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest put(RequestOptions options)
options
- the request optionsHttpClientRequest put(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpClientRequest put(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpClientRequest put(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClientRequest put(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest put(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest put(String requestURI)
requestURI
- the relative URIHttpClientRequest put(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest putAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpClientRequest putAbs(String absoluteURI, Handler<HttpClientResponse> responseHandler)
absoluteURI
- the absolute URIresponseHandler
- the response handlerHttpClientRequest delete(RequestOptions options)
options
- the request optionsHttpClientRequest delete(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpClientRequest delete(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpClientRequest delete(RequestOptions options, Handler<HttpClientResponse> responseHandler)
options
- the request optionsresponseHandler
- the response handlerHttpClientRequest delete(int port, String host, String requestURI, Handler<HttpClientResponse> responseHandler)
port
- the porthost
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest delete(String host, String requestURI, Handler<HttpClientResponse> responseHandler)
host
- the hostrequestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest delete(String requestURI)
requestURI
- the relative URIHttpClientRequest delete(String requestURI, Handler<HttpClientResponse> responseHandler)
requestURI
- the relative URIresponseHandler
- the response handlerHttpClientRequest deleteAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpClientRequest deleteAbs(String absoluteURI, Handler<HttpClientResponse> responseHandler)
absoluteURI
- the absolute URIresponseHandler
- the response handlerHttpClient websocket(RequestOptions options, Handler<WebSocket> wsConnect)
options
- the request optionswsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(int port, String host, String requestURI, Handler<WebSocket> wsConnect)
port
- the porthost
- the hostrequestURI
- the relative URIwsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(RequestOptions options, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
options
- the request optionswsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(int port, String host, String requestURI, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
port
- the porthost
- the hostrequestURI
- the relative URIwsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String host, String requestURI, Handler<WebSocket> wsConnect)
host
- the hostrequestURI
- the relative URIwsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String host, String requestURI, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
host
- the hostrequestURI
- the relative URIwsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(RequestOptions options, MultiMap headers, Handler<WebSocket> wsConnect)
options
- the request optionsheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(int port, String host, String requestURI, MultiMap headers, Handler<WebSocket> wsConnect)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(RequestOptions options, MultiMap headers, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
options
- the request optionsheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(int port, String host, String requestURI, MultiMap headers, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String host, String requestURI, MultiMap headers, Handler<WebSocket> wsConnect)
host
- the hostrequestURI
- the relative URIheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String host, String requestURI, MultiMap headers, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
host
- the hostrequestURI
- the relative URIheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect)
options
- the request optionsheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(int port, String host, String requestURI, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
options
- the request optionsheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(int port, String host, String requestURI, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect)
host
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
host
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect)
options
- the request optionsheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to usewsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(int port, String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to usewsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(RequestOptions options, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
options
- the request optionsheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to usewsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(int port, String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to usewsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect)
host
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to usewsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
host
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to usewsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String requestURI, Handler<WebSocket> wsConnect)
requestURI
- the relative URIwsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String requestURI, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
requestURI
- the relative URIwsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String requestURI, MultiMap headers, Handler<WebSocket> wsConnect)
requestURI
- the relative URIheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String requestURI, MultiMap headers, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
requestURI
- the relative URIheaders
- the headerswsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect)
requestURI
- the relative URIheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
requestURI
- the relative URIheaders
- the headersversion
- the websocket versionwsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsHttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect)
requestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocolswsConnect
- handler that will be called with the websocket when connectedHttpClient websocket(String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols, Handler<WebSocket> wsConnect, Handler<Throwable> failureHandler)
requestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocolswsConnect
- handler that will be called with the websocket when connectedfailureHandler
- handler that will be called if websocket connection failsReadStream<WebSocket> websocketStream(RequestOptions options)
options
- the request optionsReadStream<WebSocket> websocketStream(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIReadStream<WebSocket> websocketStream(String host, String requestURI)
host
- the hostrequestURI
- the relative URIReadStream<WebSocket> websocketStream(RequestOptions options, MultiMap headers)
options
- the request optionsheaders
- the headersReadStream<WebSocket> websocketStream(int port, String host, String requestURI, MultiMap headers)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headersReadStream<WebSocket> websocketStream(String host, String requestURI, MultiMap headers)
host
- the hostrequestURI
- the relative URIheaders
- the headersReadStream<WebSocket> websocketStream(RequestOptions options, MultiMap headers, WebsocketVersion version)
options
- the request optionsheaders
- the headersversion
- the websocket versionReadStream<WebSocket> websocketStream(int port, String host, String requestURI, MultiMap headers, WebsocketVersion version)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionReadStream<WebSocket> websocketStream(String host, String requestURI, MultiMap headers, WebsocketVersion version)
host
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionReadStream<WebSocket> websocketStream(RequestOptions options, MultiMap headers, WebsocketVersion version, String subProtocols)
options
- the request optionsheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to useReadStream<WebSocket> websocketStream(int port, String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols)
port
- the porthost
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to useReadStream<WebSocket> websocketStream(String host, String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols)
host
- the hostrequestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocols to useReadStream<WebSocket> websocketStream(String requestURI)
requestURI
- the relative URIReadStream<WebSocket> websocketStream(String requestURI, MultiMap headers)
requestURI
- the relative URIheaders
- the headersReadStream<WebSocket> websocketStream(String requestURI, MultiMap headers, WebsocketVersion version)
requestURI
- the relative URIheaders
- the headersversion
- the websocket versionReadStream<WebSocket> websocketStream(String requestURI, MultiMap headers, WebsocketVersion version, String subProtocols)
requestURI
- the relative URIheaders
- the headersversion
- the websocket versionsubProtocols
- the subprotocolsHttpClient redirectHandler(Function<HttpClientResponse,Future<HttpClientRequest>> handler)
The redirect handler is called when a 3xx
response is received and the request is configured to
follow redirects with HttpClientRequest.setFollowRedirects(boolean)
.
The redirect handler is passed the HttpClientResponse
, it can return an HttpClientRequest
or null
.
Future<HttpClientRequest>
is returned, the client will send this new requestFuture<HttpClientRequest>
unsent so the client can further configure it and send it.handler
- the new redirect handlerFunction<HttpClientResponse,Future<HttpClientRequest>> redirectHandler()
void close()
Copyright © 2017. All rights reserved.