public interface HttpResponse<T> extends HttpResponseHead
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.
Modifier and Type | Method and Description |
---|---|
T |
body() |
Buffer |
bodyAsBuffer() |
default <R> R |
bodyAsJson(Class<R> type) |
JsonArray |
bodyAsJsonArray() |
default JsonObject |
bodyAsJsonObject() |
default String |
bodyAsString() |
default String |
bodyAsString(String encoding) |
List<String> |
followedRedirects() |
String |
getTrailer(String trailerName)
Return the first trailer value with the specified name
|
MultiMap |
trailers() |
cookies, getHeader, getHeader, headers, statusCode, statusMessage, version
MultiMap trailers()
String getTrailer(String trailerName)
trailerName
- the trailer nameT body()
Buffer bodyAsBuffer()
Buffer
, or null
if a codec other than BodyCodec.buffer()
was usedList<String> followedRedirects()
default String bodyAsString()
String
, or null
if a codec other than BodyCodec.buffer()
was useddefault String bodyAsString(String encoding)
String
given a specific encoding
, or null
if a codec other than BodyCodec.buffer()
was useddefault JsonObject bodyAsJsonObject()
JsonObject
, or null
if a codec other than BodyCodec.buffer()
was usedJsonArray bodyAsJsonArray()
JsonArray
, or null
if a codec other than BodyCodec.buffer()
was useddefault <R> R bodyAsJson(Class<R> type)
type
with the Jackson mapper, or null
if a codec other than BodyCodec.buffer()
was usedCopyright © 2024 Eclipse. All rights reserved.