Interface HttpResponse<T>
- All Superinterfaces:
HttpResponseHead
An HTTP response.
The usual HTTP response attributes are available:
HttpResponseHead.statusCode()the HTTP status codeHttpResponseHead.statusMessage()the HTTP status messageHttpResponseHead.headers()the HTTP headersHttpResponseHead.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
Modifier and TypeMethodDescriptionbody()default <R> RbodyAsJson(Class<R> type) default JsonObjectdefault Stringdefault StringbodyAsString(String encoding) getTrailer(String trailerName) Return the first trailer value with the specified nametrailers()Methods inherited from interface HttpResponseHead
cookies, getHeader, getHeader, headers, statusCode, statusMessage, version
-
Method Details
-
trailers
MultiMap trailers()- Returns:
- the trailers
-
getTrailer
-
body
T body()- Returns:
- the response body in the format it was decoded.
-
bodyAsBuffer
Buffer bodyAsBuffer()- Returns:
- the response body decoded as a
Buffer, ornullif a codec other thanBodyCodec.buffer()was used
-
followedRedirects
-
bodyAsString
- Returns:
- the response body decoded as a
String, ornullif a codec other thanBodyCodec.buffer()was used
-
bodyAsString
- Returns:
- the response body decoded as a
Stringgiven a specificencoding, ornullif a codec other thanBodyCodec.buffer()was used
-
bodyAsJsonObject
- Returns:
- the response body decoded as
JsonObject, ornullif a codec other thanBodyCodec.buffer()was used
-
bodyAsJsonArray
JsonArray bodyAsJsonArray()- Returns:
- the response body decoded as a
JsonArray, ornullif a codec other thanBodyCodec.buffer()was used
-
bodyAsJson
- Returns:
- the response body decoded as the specified
typewith the Jackson mapper, ornullif a codec other thanBodyCodec.buffer()was used
-