public class AsyncRequestClient extends java.lang.Object implements RequestClient
Modifier and Type | Class and Description |
---|---|
static class |
AsyncRequestClient.Builder
AsyncRequestClient Builder.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying HTTP client's thread pool.
|
<T> java.util.concurrent.Future<Response> |
executeAsync(Request<T> request,
ResponseCallback callback,
java.util.Map<java.lang.String,java.lang.String> headers)
Executes the HTTP request.
|
java.net.URI |
getBaseUri()
Get the base URI used for the client.
|
DefaultAsyncHttpClientConfig |
getClientConfig()
Get the client config.
|
java.util.Optional<ProxyServer> |
getProxyServer()
Get the proxy server.
|
static AsyncRequestClient.Builder |
newBuilder()
New AsyncRequestClient Builder.
|
public static AsyncRequestClient.Builder newBuilder()
public java.net.URI getBaseUri()
public java.util.Optional<ProxyServer> getProxyServer()
public DefaultAsyncHttpClientConfig getClientConfig()
public <T> java.util.concurrent.Future<Response> executeAsync(Request<T> request, ResponseCallback callback, java.util.Map<java.lang.String,java.lang.String> headers)
RequestClient
executeAsync
in interface RequestClient
T
- typerequest
- the Request.callback
- the ResponseCallback.headers
- a Map of the headers.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException