public interface HttpResponse<T>
The usual HTTP response attributes are available:
statusCode()
the HTTP status codestatusMessage()
the HTTP status messageheaders()
the HTTP headersversion()
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> |
cookies() |
List<String> |
followedRedirects() |
String |
getHeader(String headerName)
Return the first header value with the specified name
|
String |
getTrailer(String trailerName)
Return the first trailer value with the specified name
|
MultiMap |
headers() |
int |
statusCode() |
String |
statusMessage() |
MultiMap |
trailers() |
HttpVersion |
version() |
HttpVersion version()
int statusCode()
String statusMessage()
MultiMap headers()
String getHeader(String headerName)
headerName
- the header nameMultiMap 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 © 2021 Eclipse. All rights reserved.