diff --git a/src/reference/docbook/http.xml b/src/reference/docbook/http.xml index 842eb92330..fc3462b394 100644 --- a/src/reference/docbook/http.xml +++ b/src/reference/docbook/http.xml @@ -162,7 +162,7 @@ By default the HTTP request will be generated using an instance of Si HTTP is a request/response protocol. However the response may not have a body, just headers. In this case, the HttpRequestExecutingMessageHandler produces a reply Message with the payload being - an org.springframework.http.HttpEntity, regardless of any + an org.springframework.http.ResponseEntity, regardless of any provided expected-response-type. According to the HTTP RFC Status Code Definitions, there are many statuses which identify that a response MUST NOT contain a message-body (e.g. 204 No Content). @@ -170,9 +170,22 @@ By default the HTTP request will be generated using an instance of Si the first request to an HTTP resource returns content, but the second does not (e.g. 304 Not Modified). In all cases, however, the http_statusCode message header is populated. This can be used in some routing logic after the Http Outbound Gateway. You could also use a - <payload-type-router/> to route messages with an HttpEntity + <payload-type-router/> to route messages with an ResponseEntity to a different flow than that used for responses with a body. + + Note: expected-response-type + + Further to the note above regarding empty response bodies, if a response + does contain a body, you must provide an appropriate + expected-response-type attribute or, again, you will simply receive a + ResponseEntity with no body. The expected-response-type + must be compatible with the (configured or default) HttpMessageConverters + and the Content-Type header in the response. Of course, this can be an abstract + class, or even an interface (such as java.io.Serializable when + using java serialization and Content-Type: application/x-java-serialized-object). + +