final class SimpleStreamingAsyncClientHttpRequest extends AbstractAsyncClientHttpRequest
ClientHttpRequest
implementation that uses
standard Java facilities to execute streaming requests. Created via the SimpleClientHttpRequestFactory
.SimpleClientHttpRequestFactory.createRequest(java.net.URI, org.springframework.http.HttpMethod)
Modifier and Type | Field and Description |
---|---|
private java.io.OutputStream |
body |
private int |
chunkSize |
private java.net.HttpURLConnection |
connection |
private boolean |
outputStreaming |
private AsyncListenableTaskExecutor |
taskExecutor |
Constructor and Description |
---|
SimpleStreamingAsyncClientHttpRequest(java.net.HttpURLConnection connection,
int chunkSize,
boolean outputStreaming,
AsyncListenableTaskExecutor taskExecutor) |
Modifier and Type | Method and Description |
---|---|
protected ListenableFuture<ClientHttpResponse> |
executeInternal(HttpHeaders headers)
Abstract template method that writes the given headers and content to the HTTP request.
|
protected java.io.OutputStream |
getBodyInternal(HttpHeaders headers)
Abstract template method that returns the body.
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
java.net.URI |
getURI()
Return the URI of the request.
|
assertNotExecuted, executeAsync, getBody, getHeaders
private final java.net.HttpURLConnection connection
private final int chunkSize
private java.io.OutputStream body
private final boolean outputStreaming
private final AsyncListenableTaskExecutor taskExecutor
SimpleStreamingAsyncClientHttpRequest(java.net.HttpURLConnection connection, int chunkSize, boolean outputStreaming, AsyncListenableTaskExecutor taskExecutor)
public HttpMethod getMethod()
HttpRequest
null
if not resolvable (e.g. in case of a non-standard HTTP method)public java.net.URI getURI()
HttpRequest
null
)protected java.io.OutputStream getBodyInternal(HttpHeaders headers) throws java.io.IOException
AbstractAsyncClientHttpRequest
getBodyInternal
in class AbstractAsyncClientHttpRequest
headers
- the HTTP headersjava.io.IOException
protected ListenableFuture<ClientHttpResponse> executeInternal(HttpHeaders headers) throws java.io.IOException
AbstractAsyncClientHttpRequest
executeInternal
in class AbstractAsyncClientHttpRequest
headers
- the HTTP headersjava.io.IOException