public class HttpResponse<T> extends Object
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 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.
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static TypeArg<HttpResponse> |
__TYPE_ARG |
TypeArg<T> |
__typeArg_0 |
Constructor and Description |
---|
HttpResponse(HttpResponse delegate) |
HttpResponse(HttpResponse delegate,
TypeArg<T> typeArg_0) |
Modifier and Type | Method and Description |
---|---|
T |
body() |
Buffer |
bodyAsBuffer() |
<R> R |
bodyAsJson(Class<R> type) |
JsonObject |
bodyAsJsonObject() |
String |
bodyAsString() |
String |
bodyAsString(String encoding) |
List<String> |
cookies() |
HttpResponse |
getDelegate() |
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() |
static <T> HttpResponse |
newInstance(HttpResponse arg) |
static <T> HttpResponse |
newInstance(HttpResponse arg,
TypeArg<T> __typeArg_T) |
int |
statusCode() |
String |
statusMessage() |
MultiMap |
trailers() |
HttpVersion |
version() |
public static final TypeArg<HttpResponse> __TYPE_ARG
public HttpResponse(HttpResponse delegate)
public HttpResponse(HttpResponse delegate, TypeArg<T> typeArg_0)
public HttpResponse getDelegate()
public HttpVersion version()
public int statusCode()
public String statusMessage()
public MultiMap headers()
public String getHeader(String headerName)
headerName
- the header namepublic MultiMap trailers()
public String getTrailer(String trailerName)
trailerName
- the trailer namepublic T body()
public Buffer bodyAsBuffer()
public String bodyAsString()
String
public String bodyAsString(String encoding)
encoding
- String
given a specific encoding
public JsonObject bodyAsJsonObject()
public <R> R bodyAsJson(Class<R> type)
type
- type
with the Jackson mapper.public static <T> HttpResponse newInstance(HttpResponse arg)
public static <T> HttpResponse newInstance(HttpResponse arg, TypeArg<T> __typeArg_T)
Copyright © 2017. All rights reserved.