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() |
io.vertx.core.buffer.Buffer |
bodyAsBuffer() |
default <R> R |
bodyAsJson(Class<R> type) |
io.vertx.core.json.JsonArray |
bodyAsJsonArray() |
default io.vertx.core.json.JsonObject |
bodyAsJsonObject() |
default String |
bodyAsString() |
default String |
bodyAsString(String encoding) |
List<String> |
cookies() |
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
|
io.vertx.core.MultiMap |
headers() |
int |
statusCode() |
String |
statusMessage() |
io.vertx.core.MultiMap |
trailers() |
io.vertx.core.http.HttpVersion |
version() |
io.vertx.core.http.HttpVersion version()
int statusCode()
String statusMessage()
io.vertx.core.MultiMap headers()
String getHeader(String headerName)
headerName
- the header nameio.vertx.core.MultiMap trailers()
String getTrailer(String trailerName)
trailerName
- the trailer nameT body()
io.vertx.core.buffer.Buffer bodyAsBuffer()
Buffer
default String bodyAsString()
String
default String bodyAsString(String encoding)
String
given a specific encoding
default io.vertx.core.json.JsonObject bodyAsJsonObject()
io.vertx.core.json.JsonArray bodyAsJsonArray()
default <R> R bodyAsJson(Class<R> type)
type
with the Jackson mapper.Copyright © 2018 Eclipse. All rights reserved.