final class SimpleBufferingClientHttpRequest extends AbstractBufferingClientHttpRequest
ClientHttpRequest
implementation that uses standard JDK facilities to
execute buffered requests. Created via the SimpleClientHttpRequestFactory
.SimpleClientHttpRequestFactory.createRequest(java.net.URI, HttpMethod)
Modifier and Type | Field and Description |
---|---|
private java.net.HttpURLConnection |
connection |
private boolean |
outputStreaming |
Constructor and Description |
---|
SimpleBufferingClientHttpRequest(java.net.HttpURLConnection connection,
boolean outputStreaming) |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addHeaders(java.net.HttpURLConnection connection,
HttpHeaders headers)
Add the given headers to the given HTTP connection.
|
protected ClientHttpResponse |
executeInternal(HttpHeaders headers,
byte[] bufferedOutput)
Abstract template method that writes the given headers and content to the HTTP request.
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
java.net.URI |
getURI()
Return the URI of the request.
|
executeInternal, getBodyInternal
assertNotExecuted, execute, getBody, getHeaders
private final java.net.HttpURLConnection connection
private final boolean outputStreaming
SimpleBufferingClientHttpRequest(java.net.HttpURLConnection connection, boolean outputStreaming)
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 ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput) throws java.io.IOException
AbstractBufferingClientHttpRequest
executeInternal
in class AbstractBufferingClientHttpRequest
headers
- the HTTP headersbufferedOutput
- the body contentjava.io.IOException
static void addHeaders(java.net.HttpURLConnection connection, HttpHeaders headers)
connection
- the connection to add the headers toheaders
- the headers to add