Class: HttpResponse

vertx-web-client-js/http_response~ HttpResponse

new HttpResponse()

An HTTP response.

The usual HTTP response attributes are available:

Source:

Methods

body() → {Object}

Source:
Returns:
the response body in the format it was decoded.
Type
Object

bodyAsBuffer() → {Buffer}

Source:
Returns:
the response body decoded as a
Type
Buffer

bodyAsJson(type) → {Object}

Parameters:
Name Type Description
type todo
Source:
Returns:
the response body decoded as the specified type with the Jackson mapper.
Type
Object

bodyAsJsonArray() → {todo}

Source:
Returns:
the response body decoded as a json array
Type
todo

bodyAsJsonObject() → {Object}

Source:
Returns:
the response body decoded as a json object
Type
Object

bodyAsString(encoding) → {string}

Parameters:
Name Type Description
encoding string
Source:
Returns:
the response body decoded as a String given a specific encoding
Type
string

cookies() → {Array.<string>}

Source:
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:
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:
Returns:
the trailer value
Type
string

headers() → {MultiMap}

Source:
Returns:
the headers
Type
MultiMap

statusCode() → {number}

Source:
Returns:
the status code of the response
Type
number

statusMessage() → {string}

Source:
Returns:
the status message of the response
Type
string

trailers() → {MultiMap}

Source:
Returns:
the trailers
Type
MultiMap

version() → {Object}

Source:
Returns:
the version of the response
Type
Object