ClientHttpResponse (Spring Framework 3.2.1.RELEASE API)
Date: 2013-01-24

org.springframework.http.client

## Interface ClientHttpResponse

- All Superinterfaces:
    AutoCloseable, Closeable, HttpInputMessage, HttpMessage
  All Known Implementing Classes:
    AbstractClientHttpResponse, MockClientHttpResponse

      public interface ClientHttpResponse
      extends HttpInputMessage, Closeable

  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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`