The maximum amount of time a request will wait to obtain an HTTP connection.
The ExecutionContext that will be used to run the user code.
The host this client is connected to.
The maximum number of TCP connections maintained with the remote server.
The client options such as the number of IO thread used.
The TCP port this client is connected to.
The scheme used by this client (either HTTP or HTTPS if connected in SSL).
The SSL configuration used by the client.
The SSL configuration used by the client. Must be provided if the server certificate is not recognized by default.
Send a request to the server and eventually give back the response.
Send a request to the server and eventually give back the response.
the HTTP request to be sent to the server.
if true follow the intermediate HTTP redirects.
maximum amount of time allowed to retrieve the response.
eventually the HTTP response.
Send a request to the server and eventually give back the response.
Send a request to the server and eventually give back the response.
the HTTP request to be sent to the server.
eventually the HTTP response.
Check if this client is already closed (ie.
Check if this client is already closed (ie. it does not accept any more requests).
The number of TCP connections currently opened with the remote server.
Send this request to the server, eventually run the given function and return the result.
Send this request to the server, eventually run the given function and return the result.
This operation ensures that the response content stream is fully read even if the provided
user code do not consume it. The response is drained as soon as the f
function returns.
the HTTP request to be sent to the server.
if true follow the intermediate HTTP redirects. Default to true.
maximum amount of time allowed to retrieve the response and extract the return value.
a function that eventually receive the response and transform it to a value of type A
.
eventually a value of type A
.
Run the given function and close the client.
Run the given function and close the client.
a function that take a client and eventually return a value of type A
.
eventually a value of type A
.
Stop the client and kill all current and waiting requests.
Stop the client and kill all current and waiting requests.
a Future resolved as soon as the client is shutdown.
An HTTP client.
An HTTP client is a Service function. It handles HTTP requests and eventually returns HTTP responses.
A client maintains several TCP connections to the remote server. These connections are used to send requests and are blocked until the corresponding response has been received. If no connection is available when a new request comes, it waits for connectionTimeout time for one connection to become available.
It is important that the user code completly consumes the response content stream, so the connection is freed for the next request. That's why it is better to use the
run
operation if possible since this one automatically drains the request upon return.If the request to execute does not specify an Host header, it will be automatically added and set to the value of the client
host
.