org.springframework.web.client
Class RestTemplate.HttpEntityRequestCallback

java.lang.Object
  extended by org.springframework.web.client.RestTemplate.AcceptHeaderRequestCallback
      extended by org.springframework.web.client.RestTemplate.HttpEntityRequestCallback
All Implemented Interfaces:
RequestCallback
Enclosing class:
RestTemplate

private class RestTemplate.HttpEntityRequestCallback
extends RestTemplate.AcceptHeaderRequestCallback

Request callback implementation that writes the given object to the request stream.


Field Summary
private  HttpEntity requestEntity
           
 
Constructor Summary
private RestTemplate.HttpEntityRequestCallback(java.lang.Object requestBody)
           
private RestTemplate.HttpEntityRequestCallback(java.lang.Object requestBody, java.lang.Class<?> responseType)
           
 
Method Summary
 void doWithRequest(ClientHttpRequest httpRequest)
          Gets called by RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...) with an opened ClientHttpRequest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestEntity

private final HttpEntity requestEntity
Constructor Detail

RestTemplate.HttpEntityRequestCallback

private RestTemplate.HttpEntityRequestCallback(java.lang.Object requestBody)

RestTemplate.HttpEntityRequestCallback

private RestTemplate.HttpEntityRequestCallback(java.lang.Object requestBody,
                                               java.lang.Class<?> responseType)
Method Detail

doWithRequest

public void doWithRequest(ClientHttpRequest httpRequest)
                   throws java.io.IOException
Description copied from interface: RequestCallback
Gets called by RestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.RequestCallback, org.springframework.web.client.ResponseExtractor, java.lang.Object...) with an opened ClientHttpRequest. Does not need to care about closing the request or about handling errors: this will all be handled by the RestTemplate.

Specified by:
doWithRequest in interface RequestCallback
Overrides:
doWithRequest in class RestTemplate.AcceptHeaderRequestCallback
Parameters:
httpRequest - the active HTTP request
Throws:
java.io.IOException - in case of I/O errors