Package io.vertx.ext.web.client

## Interface HttpResponse<T>

- All Superinterfaces:
    `HttpResponseHead`

      public interface HttpResponse<T>
      extends HttpResponseHead

  An HTTP response.

  The usual HTTP response attributes are available:

  - `HttpResponseHead.statusCode()` the HTTP status code
  - `HttpResponseHead.statusMessage()` the HTTP status message
  - `HttpResponseHead.headers()` the HTTP headers
  - `HttpResponseHead.version()` the HTTP version

  The body of the response is returned by `body()` decoded as the format specified by the `BodyCodec` that built the response.

  Keep in mind that using this `HttpResponse` impose to fully buffer the response body and should be used for payload that can fit in memory.

  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `T` | `body()` |
    `Buffer` | `bodyAsBuffer()` |
    `default <R> R` | `bodyAsJson​(Class<R> type)` |
    `JsonArray` | `bodyAsJsonArray()` |
    `default JsonObject` | `bodyAsJsonObject()` |
    `default String` | `bodyAsString()` |
    `default String` | `bodyAsString​(String encoding)` |
    `List<String>` | `followedRedirects()` |
    `String` | `getTrailer​(String trailerName)` | Return the first trailer value with the specified name
    `MultiMap` | `trailers()` |

    - ### Methods inherited from interface io.vertx.core.http.HttpResponseHead

      `cookies, getHeader, getHeader, headers, statusCode, statusMessage, version`

- - ### Method Detail

    - #### trailers

          MultiMap trailers()

      Returns:
        the trailers

    - #### getTrailer

          String getTrailer​(String trailerName)

      Return the first trailer value with the specified name
      Parameters:
        `trailerName` - the trailer name
      Returns:
        the trailer value

    - #### body

          T body()

      Returns:
        the response body in the format it was decoded.

    - #### bodyAsBuffer

          Buffer bodyAsBuffer()

      Returns:
        the response body decoded as a `Buffer`, or `null` if a codec other than `BodyCodec.buffer()` was used

    - #### followedRedirects

          List<String> followedRedirects()

      Returns:
        the list of all followed redirects, including the final location.

    - #### bodyAsString

          default String bodyAsString()

      Returns:
        the response body decoded as a `String`, or `null` if a codec other than `BodyCodec.buffer()` was used

    - #### bodyAsString

          default String bodyAsString​(String encoding)

      Returns:
        the response body decoded as a `String` given a specific `encoding`, or `null` if a codec other than `BodyCodec.buffer()` was used

    - #### bodyAsJsonObject

          default JsonObject bodyAsJsonObject()

      Returns:
        the response body decoded as `JsonObject`, or `null` if a codec other than `BodyCodec.buffer()` was used

    - #### bodyAsJsonArray

          JsonArray bodyAsJsonArray()

      Returns:
        the response body decoded as a `JsonArray`, or `null` if a codec other than `BodyCodec.buffer()` was used

    - #### bodyAsJson

          default <R> R bodyAsJson​(Class<R> type)

      Returns:
        the response body decoded as the specified `type` with the Jackson mapper, or `null` if a codec other than `BodyCodec.buffer()` was used