final class HttpComponentsStreamingClientHttpRequest extends AbstractClientHttpRequest implements StreamingHttpOutputMessage
ClientHttpRequest
implementation based on
Apache HttpComponents HttpClient in streaming mode.
Created via the HttpComponentsClientHttpRequestFactory
.
HttpComponentsClientHttpRequestFactory.createRequest(java.net.URI, org.springframework.http.HttpMethod)
Modifier and Type | Class and Description |
---|---|
private static class |
HttpComponentsStreamingClientHttpRequest.StreamingHttpEntity |
StreamingHttpOutputMessage.Body
Modifier and Type | Field and Description |
---|---|
private StreamingHttpOutputMessage.Body |
body |
private HttpClient |
httpClient |
private HttpContext |
httpContext |
private HttpUriRequest |
httpRequest |
Constructor and Description |
---|
HttpComponentsStreamingClientHttpRequest(HttpClient client,
HttpUriRequest request,
HttpContext context) |
Modifier and Type | Method and Description |
---|---|
protected 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.
|
void |
setBody(StreamingHttpOutputMessage.Body body)
Set the streaming body for this message.
|
assertNotExecuted, execute, getBody, getHeaders
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBody
getHeaders
private final HttpClient httpClient
private final HttpUriRequest httpRequest
private final HttpContext httpContext
private StreamingHttpOutputMessage.Body body
HttpComponentsStreamingClientHttpRequest(HttpClient client, HttpUriRequest request, HttpContext context)
public HttpMethod getMethod()
HttpRequest
getMethod
in interface HttpRequest
null
if not resolvable (e.g. in case of a non-standard HTTP method)public java.net.URI getURI()
HttpRequest
getURI
in interface HttpRequest
null
)public void setBody(StreamingHttpOutputMessage.Body body)
StreamingHttpOutputMessage
setBody
in interface StreamingHttpOutputMessage
body
- the streaming bodyprotected java.io.OutputStream getBodyInternal(HttpHeaders headers) throws java.io.IOException
AbstractClientHttpRequest
getBodyInternal
in class AbstractClientHttpRequest
headers
- the HTTP headersjava.io.IOException
protected ClientHttpResponse executeInternal(HttpHeaders headers) throws java.io.IOException
AbstractClientHttpRequest
executeInternal
in class AbstractClientHttpRequest
headers
- the HTTP headersjava.io.IOException