new HttpResponse()
An HTTP response.
The usual HTTP response attributes are available:
Methods
body() → {Object}
Returns:
the response body in the format it was decoded.
- Type
- Object
bodyAsBuffer() → {Buffer}
Returns:
the response body decoded as a
- Type
- Buffer
bodyAsJson(type) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
type |
todo |
Returns:
the response body decoded as the specified
type
with the Jackson mapper.
- Type
- Object
bodyAsJsonArray() → {todo}
Returns:
the response body decoded as a json array
- Type
- todo
bodyAsJsonObject() → {Object}
Returns:
the response body decoded as a json object
- Type
- Object
bodyAsString(encoding) → {string}
Parameters:
Name | Type | Description |
---|---|---|
encoding |
string |
Returns:
the response body decoded as a
String
given a specific encoding
- Type
- string
cookies() → {Array.<string>}
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 |
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 |
Returns:
the trailer value
- Type
- string
headers() → {MultiMap}
Returns:
the headers
- Type
- MultiMap
statusCode() → {number}
Returns:
the status code of the response
- Type
- number
statusMessage() → {string}
Returns:
the status message of the response
- Type
- string
trailers() → {MultiMap}
Returns:
the trailers
- Type
- MultiMap
version() → {Object}
Returns:
the version of the response
- Type
- Object