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 port this client is connected to.
The protocol used by this client.
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.
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.
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
.
Run the given function and close the client.
Run the given function and close the client. This operation is blocking and the calling thread will wait for the call to be completed.
a function that take a client and eventually return a value of type A
.
a value of type A
.
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.
This operation is block and the calling thread will wait for the call to be completed.
the HTTP request to be sent to the server.
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
.
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.
This operation returns an IO
and is lazy. If you want to stop
the client immediatly and synchronously use stopSync instead.
a IO effect resolved as soon as the client is shutdown.
Stop the client and kill all current and waiting requests right away.
(Since version ) see corresponding Javadoc for more information.
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 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
.