io.vertx.ext.web.client

## Interface HttpResponse<T>

-     public interface HttpResponse<T>

  An HTTP response.

  The usual HTTP response attributes are available:

  - `statusCode()` the HTTP status code
  - `statusMessage()` the HTTP status message
  - `headers()` the HTTP headers
  - `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
    Modifier and Type | Method and Description
    --- | ---
    `T` | `body()`
    `Buffer` | `bodyAsBuffer()`
    `<R> R` | `bodyAsJson(Class<R> type)`
    `JsonArray` | `bodyAsJsonArray()`
    `JsonObject` | `bodyAsJsonObject()`
    `String` | `bodyAsString()`
    `String` | `bodyAsString(String encoding)`
    `List<String>` | `cookies()`
    `String` | `getHeader(String headerName)` Return the first header value with the specified name
    `String` | `getTrailer(String trailerName)` Return the first trailer value with the specified name
    `MultiMap` | `headers()`
    `int` | `statusCode()`
    `String` | `statusMessage()`
    `MultiMap` | `trailers()`
    `HttpVersion` | `version()`

- - ### Method Detail

    - #### version

          HttpVersion version()

      Returns:
        the version of the response

    - #### statusCode

          int statusCode()

      Returns:
        the status code of the response

    - #### statusMessage

          String statusMessage()

      Returns:
        the status message of the response

    - #### headers

          MultiMap headers()

      Returns:
        the headers

    - #### getHeader

          String getHeader(String headerName)

      Return the first header value with the specified name
      Parameters:
        `headerName` - the header name
      Returns:
        the header value

    - #### 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

    - #### cookies

          List<String> cookies()

      Returns:
        the Set-Cookie headers (including trailers)

    - #### body

          T body()

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

    - #### bodyAsBuffer

          Buffer bodyAsBuffer()

      Returns:
        the response body decoded as a `Buffer`

    - #### bodyAsString

          String bodyAsString()

      Returns:
        the response body decoded as a `String`

    - #### bodyAsString

          String bodyAsString(String encoding)

      Returns:
        the response body decoded as a `String` given a specific `encoding`

    - #### bodyAsJsonObject

          JsonObject bodyAsJsonObject()

      Returns:
        the response body decoded as a json object

    - #### bodyAsJsonArray

          JsonArray bodyAsJsonArray()

      Returns:
        the response body decoded as a json array

    - #### bodyAsJson

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

      Returns:
        the response body decoded as the specified `type` with the Jackson mapper.

Copyright © 2017. All rights reserved.