ClientHttpRequest implementation based on
Apache HttpComponents HttpClient.
Created via the HttpComponentsClientHttpRequestFactory.
HttpComponentsClientHttpRequestFactory#createRequest(URI, HttpMethod)
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final HttpClient | |
| private final HttpContext | |
| private final ClassicHttpRequest |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | addHeaders(ClassicHttpRequest
the request to add the headers to httpRequest, HttpHeaders the headers to add headers)Add the given headers to the given HTTP request. |
| protected ClientHttpResponse | executeInternal(HttpHeaders
the HTTP headers headers, StreamingHttpOutputMessage.the HTTP body, may be bodynull if no body was setImplements abstract org. Abstract template method that writes the given headers and content to the HTTP request. |
| pack-priv HttpContext | |
| public HttpMethod | getMethod()
Implements org. Return the HTTP method of the request. |
| public URI | getURI()
Implements org. Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation). |
| httpClient | back to summary |
|---|---|
| private final HttpClient httpClient | |
| httpContext | back to summary |
|---|---|
| private final HttpContext httpContext | |
| httpRequest | back to summary |
|---|---|
| private final ClassicHttpRequest httpRequest | |
| HttpComponentsClientHttpRequest | back to summary |
|---|---|
| pack-priv HttpComponentsClientHttpRequest(HttpClient client, ClassicHttpRequest request, HttpContext context) | |
| addHeaders | back to summary |
|---|---|
| pack-priv static void addHeaders(ClassicHttpRequest httpRequest, HttpHeaders headers) Add the given headers to the given HTTP request.
| |
| executeInternal | back to summary |
|---|---|
| protected ClientHttpResponse executeInternal(HttpHeaders headers, StreamingHttpOutputMessage. Implements abstract org. Doc from org. Abstract template method that writes the given headers and content to the HTTP request.
| |
| getHttpContext | back to summary |
|---|---|
| pack-priv HttpContext getHttpContext() | |
| getMethod | back to summary |
|---|---|
| public HttpMethod getMethod() Implements org. Doc from org. Return the HTTP method of the request.
| |
| getURI | back to summary |
|---|---|
| public URI getURI() Implements org. Doc from org. Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation). | |
| Modifier and Type | Field and Description |
|---|---|
| private final StreamingHttpOutputMessage. | |
| private final HttpHeaders |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| public InputStream | getContent()
Implements org. Returns a content stream of the entity. |
| public String | getContentEncoding()
Implements org. Returns content encoding of the entity, if known. |
| public long | getContentLength()
Implements org. Returns length of the entity, if known. |
| public String | getContentType()
Implements org. Returns content type of the entity, if known. |
| public Set | getTrailerNames()
Implements org. Preliminary declaration of trailing headers. |
| public Supplier | getTrailers()
Implements org. Returns supplier of message trailers - headers sent after message body. |
| public boolean | isChunked()
Implements org. Returns chunked transfer hint for this entity. |
| public boolean | isRepeatable()
Implements org. Tells if the entity is capable of producing its data more than once. |
| public boolean | isStreaming()
Implements org. Tells whether this entity depends on an underlying stream. |
| public void | writeTo(OutputStream
the output stream to write entity content to outStream)Implements org. Writes the entity content out to the output stream. |
| body | back to summary |
|---|---|
| private final StreamingHttpOutputMessage. | |
| headers | back to summary |
|---|---|
| private final HttpHeaders headers | |
| BodyEntity | back to summary |
|---|---|
| public BodyEntity(HttpHeaders headers, StreamingHttpOutputMessage. | |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| getContent | back to summary |
|---|---|
| public InputStream getContent() Implements org. Doc from org. Returns a content stream of the entity.
If this entity belongs to an incoming HTTP message, calling
Important Note Please note all entity implementations must ensure that
all allocated resources are properly deallocated after
the
| |
| getContentEncoding | back to summary |
|---|---|
| public String getContentEncoding() Implements org. Doc from org. Returns content encoding of the entity, if known. | |
| getContentLength | back to summary |
|---|---|
| public long getContentLength() Implements org. Doc from org. Returns length of the entity, if known.
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() Implements org. Doc from org. Returns content type of the entity, if known. | |
| getTrailerNames | back to summary |
|---|---|
| public Set Implements org. Doc from org. Preliminary declaration of trailing headers. | |
| getTrailers | back to summary |
|---|---|
| public Supplier Implements org. Doc from org. Returns supplier of message trailers - headers sent after message body.
May return | |
| isChunked | back to summary |
|---|---|
| public boolean isChunked() Implements org. Doc from org. Returns chunked transfer hint for this entity. The behavior of wrapping entities is implementation dependent, but should respect the primary purpose.
| |
| isRepeatable | back to summary |
|---|---|
| public boolean isRepeatable() Implements org. Doc from org. Tells if the entity is capable of producing its data more than once. A repeatable entity's getContent() and writeTo(OutputStream) methods can be called more than once whereas a non-repeatable entity's can not.
| |
| isStreaming | back to summary |
|---|---|
| public boolean isStreaming() Implements org. Doc from org. Tells whether this entity depends on an underlying stream.
Streamed entities that read data directly from the socket should
return
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(OutputStream outStream) throws IOException Implements org. Doc from org. Writes the entity content out to the output stream. Important Note Please note all entity implementations must ensure that all allocated resources are properly deallocated when this method returns.
| |