Class AbstractBufferingClientHttpRequest
java.lang.Object
org.springframework.http.client.AbstractClientHttpRequest
org.springframework.http.client.AbstractBufferingClientHttpRequest
- All Implemented Interfaces:
ClientHttpRequest, HttpMessage, HttpOutputMessage, HttpRequest
Base implementation of
ClientHttpRequest that buffers output
in a byte array before sending it over the wire.- Since:
- 3.0.6
- Author:
- Arjen Poutsma
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final ClientHttpResponseexecuteInternal(HttpHeaders headers) Abstract template method that writes the given headers and content to the HTTP request.protected abstract ClientHttpResponseexecuteInternal(HttpHeaders headers, byte[] bufferedOutput) Abstract template method that writes the given headers and content to the HTTP request.protected final OutputStreamgetBodyInternal(HttpHeaders headers) Abstract template method that returns the body.Methods inherited from class AbstractClientHttpRequest
assertNotExecuted, execute, getAttributes, getBody, getHeadersMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HttpRequest
getMethod, getURI
-
Constructor Details
-
AbstractBufferingClientHttpRequest
public AbstractBufferingClientHttpRequest()
-
-
Method Details
-
getBodyInternal
Description copied from class:AbstractClientHttpRequestAbstract template method that returns the body.- Specified by:
getBodyInternalin classAbstractClientHttpRequest- Parameters:
headers- the HTTP headers- Returns:
- the body output stream
-
executeInternal
Description copied from class:AbstractClientHttpRequestAbstract template method that writes the given headers and content to the HTTP request.- Specified by:
executeInternalin classAbstractClientHttpRequest- Parameters:
headers- the HTTP headers- Returns:
- the response object for the executed request
- Throws:
IOException
-
executeInternal
protected abstract ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput) throws IOException Abstract template method that writes the given headers and content to the HTTP request.- Parameters:
headers- the HTTP headersbufferedOutput- the body content- Returns:
- the response object for the executed request
- Throws:
IOException
-