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, 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 httpClient, HttpUriRequest httpRequest, HttpContext httpContext)
public HttpMethod getMethod()
HttpRequest
getMethod
in interface HttpRequest
public java.net.URI getURI()
HttpRequest
getURI
in interface HttpRequest
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