org.springframework.http.client
Interface ClientHttpResponse

All Superinterfaces:
HttpInputMessage, HttpMessage
All Known Implementing Classes:
AbstractClientHttpResponse

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.
 int getRawStatusCode()
          Return the HTTP status code of the response as integer
 HttpStatus getStatusCode()
          Return the HTTP status code of the response.
 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 IOException
Return the HTTP status code of the response.

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

getRawStatusCode

int getRawStatusCode()
                     throws IOException
Return the HTTP status code of the response as integer

Returns:
the HTTP status as an integer
Throws:
IOException - in case of I/O errors

getStatusText

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

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

close

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