final class HttpComponentsStreamingClientHttpRequest extends AbstractClientHttpRequest implements StreamingHttpOutputMessage
ClientHttpRequest implementation that uses Apache HttpComponents
HttpClient to execute requests.
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 httpClient,
HttpUriRequest httpRequest,
HttpContext httpContext) |
| 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, getHeadersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBodygetHeadersprivate final HttpClient httpClient
private final HttpUriRequest httpRequest
private final HttpContext httpContext
private StreamingHttpOutputMessage.Body body
HttpComponentsStreamingClientHttpRequest(HttpClient httpClient,
HttpUriRequest httpRequest,
HttpContext httpContext)
public HttpMethod getMethod()
HttpRequestgetMethod in interface HttpRequestnull
if not resolvable (e.g. in case of a non-standard HTTP method)public java.net.URI getURI()
HttpRequestgetURI in interface HttpRequestnull)public void setBody(StreamingHttpOutputMessage.Body body)
StreamingHttpOutputMessagesetBody in interface StreamingHttpOutputMessagebody - the streaming bodyprotected java.io.OutputStream getBodyInternal(HttpHeaders headers) throws java.io.IOException
AbstractClientHttpRequestgetBodyInternal in class AbstractClientHttpRequestheaders - the HTTP headersjava.io.IOExceptionprotected ClientHttpResponse executeInternal(HttpHeaders headers) throws java.io.IOException
AbstractClientHttpRequestexecuteInternal in class AbstractClientHttpRequestheaders - the HTTP headersjava.io.IOException