# Class: HttpClientResponse

## vertx-js/http_client_response~ HttpClientResponse

#### new HttpClientResponse()

Represents a client-side HTTP response.

Source:
  - vertx-js/http_client_response.js, line 35

### Methods

#### bodyHandler(bodyHandler) → {HttpClientResponse}

Convenience method for receiving the entire request body in one piece.

This saves you having to manually set a dataHandler and an endHandler and append the chunks of the body until the whole body received. Don't use this if your request body is large - you could potentially run out of RAM.

##### Parameters:

Name | Type | Description
--- | --- | ---
`bodyHandler` | function | This handler will be called after all the body has been received

Source:
  - vertx-js/http_client_response.js, line 240

##### Returns:

Type
  HttpClientResponse

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

Source:
  - vertx-js/http_client_response.js, line 220

##### Returns:

the Set-Cookie headers (including trailers)

Type
  Array.<string>

#### customFrameHandler(handler) → {HttpClientResponse}

Set an custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 frame. HTTP/2 permits extension of the protocol.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-js/http_client_response.js, line 258

##### Returns:

a reference to this, so the API can be used fluently

Type
  HttpClientResponse

#### endHandler(endHandler) → {HttpClientResponse}

##### Parameters:

Name | Type | Description
--- | --- | ---
`endHandler` | function |

Source:
  - vertx-js/http_client_response.js, line 107

##### Returns:

Type
  HttpClientResponse

#### exceptionHandler(handler) → {HttpClientResponse}

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-js/http_client_response.js, line 61

##### Returns:

Type
  HttpClientResponse

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

Return the first header value with the specified name

##### Parameters:

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

Source:
  - vertx-js/http_client_response.js, line 177

##### 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-js/http_client_response.js, line 191

##### Returns:

the trailer value

Type
  string

#### handler(handler) → {HttpClientResponse}

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-js/http_client_response.js, line 77

##### Returns:

Type
  HttpClientResponse

#### headers() → {MultiMap}

Source:
  - vertx-js/http_client_response.js, line 160

##### Returns:

the headers

Type
  MultiMap

#### netSocket() → {NetSocket}

Get a net socket for the underlying connection of this request.

USE THIS WITH CAUTION! Writing to the socket directly if you don't know what you're doing can easily break the HTTP protocol

One valid use-case for calling this is to receive the NetSocket after a HTTP CONNECT was issued to the remote peer and it responded with a status code of 200.

Source:
  - vertx-js/http_client_response.js, line 280

##### Returns:

the net socket

Type
  NetSocket

#### pause() → {HttpClientResponse}

Source:
  - vertx-js/http_client_response.js, line 93

##### Returns:

Type
  HttpClientResponse

#### request() → {HttpClientRequest}

Source:
  - vertx-js/http_client_response.js, line 296

##### Returns:

the corresponding request

Type
  HttpClientRequest

#### resume() → {HttpClientResponse}

Source:
  - vertx-js/http_client_response.js, line 47

##### Returns:

Type
  HttpClientResponse

#### statusCode() → {number}

Source:
  - vertx-js/http_client_response.js, line 134

##### Returns:

the status code of the response

Type
  number

#### statusMessage() → {string}

Source:
  - vertx-js/http_client_response.js, line 147

##### Returns:

the status message of the response

Type
  string

#### trailers() → {MultiMap}

Source:
  - vertx-js/http_client_response.js, line 204

##### Returns:

the trailers

Type
  MultiMap

#### version() → {Object}

Source:
  - vertx-js/http_client_response.js, line 121

##### Returns:

the version of the response

Type
  Object