An HTTP client that maintains a pool of connections to a specific host, at a specific port. The client supports pipelining of requests.
If an instance is instantiated from an event loop then the handlers of the instance will always be called on that same event loop. If an instance is instantiated from some other arbitrary Java thread (i.e. when running embedded) then and event loop will be assigned to the instance and used when any of its handlers are called.
Instances of HttpClient are thread-safe.
Anything
HttpClient
ClientBase
NetworkBase
Basic
Identifiable
Object
Anything
no subtypes hierarchy
Initializer |
HttpClient(HttpClient delegate) |
Attributes | |
connectTimeout | shared Integer connectTimeout The connect timeout in milliseconds. |
host | shared String host The host |
keepAlive | shared Boolean keepAlive Is the client keep alive? |
maxPoolSize | shared Integer maxPoolSize |
maxWebSocketFrameSize | shared Integer maxWebSocketFrameSize Get the maximum websocket frame size in bytes. |
port | shared Integer port The port |
tryUserCompression | shared Boolean tryUserCompression Returns |
verifyHost | shared Boolean verifyHost true if this client will validate the remote server's certificate hostname against the requested host |
Inherited Attributes |
Attributes inherited from: ClientBase |
Attributes inherited from: NetworkBase |
Attributes inherited from: Object hash , string |
Methods | |
close | shared void close() Close the HTTP client. This will cause any pooled HTTP connections to be closed. |
connect | shared HttpClientRequest connect(String uri) This method returns an |
connectWebsocket | shared Promise<WebSocket> connectWebsocket(String uri, WebSocketVersion? wsVersion = null, {<String->String|{String+}>*}? headers = null, String[]? subprotocols = null) Attempt to connect an HTML5 websocket to the specified URI This version of the method allows you to specify the websockets version using the You can also specify a set of headers to append to the upgrade request and specify the supported subprotocols. The connect is done asynchronously, the returned promise is resolved with the websocket Parameters:
|
delete | shared HttpClientRequest delete(String uri) This method returns an |
exceptionHandler | shared void exceptionHandler(void onError(Throwable t)) |
get | shared HttpClientRequest get(String uri) This method returns an |
head | shared HttpClientRequest head(String uri) This method returns an |
options | shared HttpClientRequest options(String uri) This method returns an |
patch | shared HttpClientRequest patch(String uri) This method returns an |
post | shared HttpClientRequest post(String uri) This method returns an |
put | shared HttpClientRequest put(String uri) This method returns an |
request | shared HttpClientRequest request(String method, String uri) This method returns an When an HTTP response is received from the server the promise |
trace | shared HttpClientRequest trace(String uri) This method returns an |
Inherited Methods |
Methods inherited from: Object equals |