org.springframework.http.client
Class AbstractBufferingClientHttpRequest

java.lang.Object
  extended by org.springframework.http.client.AbstractClientHttpRequest
      extended by org.springframework.http.client.AbstractBufferingClientHttpRequest
All Implemented Interfaces:
ClientHttpRequest, HttpMessage, HttpOutputMessage, HttpRequest

public abstract class AbstractBufferingClientHttpRequest
extends AbstractClientHttpRequest

Abstract base for ClientHttpRequest that buffers output in a byte array before sending it over the wire.

Since:
3.0.6
Author:
Arjen Poutsma

Constructor Summary
AbstractBufferingClientHttpRequest()
           
 
Method Summary
protected  ClientHttpResponse executeInternal(HttpHeaders headers)
          Abstract template method that writes the given headers and content to the HTTP request.
protected abstract  ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput)
          Abstract template method that writes the given headers and content to the HTTP request.
protected  OutputStream getBodyInternal(HttpHeaders headers)
          Abstract template method that returns the body.
 
Methods inherited from class org.springframework.http.client.AbstractClientHttpRequest
execute, getBody, getHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.http.HttpRequest
getMethod, getURI
 

Constructor Detail

AbstractBufferingClientHttpRequest

public AbstractBufferingClientHttpRequest()
Method Detail

getBodyInternal

protected OutputStream getBodyInternal(HttpHeaders headers)
                                throws IOException
Description copied from class: AbstractClientHttpRequest
Abstract template method that returns the body.

Specified by:
getBodyInternal in class AbstractClientHttpRequest
Parameters:
headers - the HTTP headers
Returns:
the body output stream
Throws:
IOException

executeInternal

protected ClientHttpResponse executeInternal(HttpHeaders headers)
                                      throws IOException
Description copied from class: AbstractClientHttpRequest
Abstract template method that writes the given headers and content to the HTTP request.

Specified by:
executeInternal in class AbstractClientHttpRequest
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 headers
bufferedOutput - the body content
Returns:
the response object for the executed request
Throws:
IOException