org.springframework.http.client
Interface ClientHttpResponse

All Superinterfaces:
HttpInputMessage, HttpMessage
All Known Implementing Classes:
CommonsClientHttpResponse, SimpleClientHttpResponse

public interface ClientHttpResponse
extends HttpInputMessage

Represents a client-side HTTP response. Obtained via an calling of the ClientHttpRequest.execute().

A ClientHttpResponse must be closed, typically in a finally block.

Since:
3.0
Author:
Arjen Poutsma

Method Summary
 void close()
          Closes this response, freeing any resources created.
 HttpStatus getStatusCode()
          Return the HTTP status code of the response.
 java.lang.String getStatusText()
          Return the HTTP status text of the response.
 
Methods inherited from interface org.springframework.http.HttpInputMessage
getBody
 
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders
 

Method Detail

getStatusCode

HttpStatus getStatusCode()
                         throws java.io.IOException
Return the HTTP status code of the response.

Returns:
the HTTP status as an HttpStatus enum value
Throws:
java.io.IOException - in case of I/O errors

getStatusText

java.lang.String getStatusText()
                               throws java.io.IOException
Return the HTTP status text of the response.

Returns:
the HTTP status text
Throws:
java.io.IOException - in case of I/O errors

close

void close()
Closes this response, freeing any resources created.