class OkHttp3AsyncClientHttpRequest extends AbstractBufferingAsyncClientHttpRequest
AsyncClientHttpRequest implementation that uses OkHttp 3.x to execute requests.
Created via the OkHttp3ClientHttpRequestFactory.
| Modifier and Type | Class and Description |
|---|---|
private static class |
OkHttp3AsyncClientHttpRequest.OkHttpListenableFuture |
| Modifier and Type | Field and Description |
|---|---|
private OkHttpClient |
client |
private HttpMethod |
method |
private java.net.URI |
uri |
| Constructor and Description |
|---|
OkHttp3AsyncClientHttpRequest(OkHttpClient client,
java.net.URI uri,
HttpMethod method) |
| Modifier and Type | Method and Description |
|---|---|
protected ListenableFuture<ClientHttpResponse> |
executeInternal(HttpHeaders headers,
byte[] content)
Abstract template method that writes the given headers and content to the HTTP request.
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
java.net.URI |
getURI()
Return the URI of the request.
|
executeInternal, getBodyInternalassertNotExecuted, executeAsync, getBody, getHeadersprivate final OkHttpClient client
private final java.net.URI uri
private final HttpMethod method
public OkHttp3AsyncClientHttpRequest(OkHttpClient client,
java.net.URI uri,
HttpMethod method)
public HttpMethod getMethod()
HttpRequestnull
if not resolvable (e.g. in case of a non-standard HTTP method)public java.net.URI getURI()
HttpRequestnull)protected ListenableFuture<ClientHttpResponse> executeInternal(HttpHeaders headers, byte[] content) throws java.io.IOException
AbstractBufferingAsyncClientHttpRequestexecuteInternal in class AbstractBufferingAsyncClientHttpRequestheaders - the HTTP headerscontent - the body contentjava.io.IOException