# Class: HttpResponse

## vertx-web-client-js/http_response~ HttpResponse

#### new HttpResponse()

An HTTP response.

The usual HTTP response attributes are available:

Source:
  - vertx-web-client-js/http_response.js, line 33

### Methods

#### body() → {Object}

Source:
  - vertx-web-client-js/http_response.js, line 169

##### Returns:

the response body in the format it was decoded.

Type
  Object

#### bodyAsBuffer() → {Buffer}

Source:
  - vertx-web-client-js/http_response.js, line 185

##### Returns:

the response body decoded as a

Type
  Buffer

#### bodyAsJson(type) → {Object}

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | todo |

Source:
  - vertx-web-client-js/http_response.js, line 251

##### Returns:

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

Type
  Object

#### bodyAsJsonArray() → {todo}

Source:
  - vertx-web-client-js/http_response.js, line 235

##### Returns:

the response body decoded as a json array

Type
  todo

#### bodyAsJsonObject() → {Object}

Source:
  - vertx-web-client-js/http_response.js, line 219

##### Returns:

the response body decoded as a json object

Type
  Object

#### bodyAsString(encoding) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`encoding` | string |

Source:
  - vertx-web-client-js/http_response.js, line 201

##### Returns:

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

Type
  string

#### cookies() → {Array.<string>}

Source:
  - vertx-web-client-js/http_response.js, line 153

##### Returns:

the Set-Cookie headers (including trailers)

Type
  Array.<string>

#### getHeader(headerName) → {string}

Return the first header value with the specified name

##### Parameters:

Name | Type | Description
--- | --- | ---
`headerName` | string | the header name

Source:
  - vertx-web-client-js/http_response.js, line 110

##### Returns:

the header value

Type
  string

#### getTrailer(trailerName) → {string}

Return the first trailer value with the specified name

##### Parameters:

Name | Type | Description
--- | --- | ---
`trailerName` | string | the trailer name

Source:
  - vertx-web-client-js/http_response.js, line 140

##### Returns:

the trailer value

Type
  string

#### headers() → {MultiMap}

Source:
  - vertx-web-client-js/http_response.js, line 93

##### Returns:

the headers

Type
  MultiMap

#### statusCode() → {number}

Source:
  - vertx-web-client-js/http_response.js, line 61

##### Returns:

the status code of the response

Type
  number

#### statusMessage() → {string}

Source:
  - vertx-web-client-js/http_response.js, line 77

##### Returns:

the status message of the response

Type
  string

#### trailers() → {MultiMap}

Source:
  - vertx-web-client-js/http_response.js, line 123

##### Returns:

the trailers

Type
  MultiMap

#### version() → {Object}

Source:
  - vertx-web-client-js/http_response.js, line 45

##### Returns:

the version of the response

Type
  Object