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 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.
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<HttpResponse> |
__TYPE_ARG |
io.vertx.lang.rx.TypeArg<T> |
__typeArg_0 |
Constructor and Description |
---|
HttpResponse(HttpResponse delegate) |
HttpResponse(Object delegate,
io.vertx.lang.rx.TypeArg<T> typeArg_0) |
Modifier and Type | Method and Description |
---|---|
T |
body() |
Buffer |
bodyAsBuffer() |
<R> R |
bodyAsJson(Class<R> type) |
JsonArray |
bodyAsJsonArray() |
JsonObject |
bodyAsJsonObject() |
String |
bodyAsString() |
String |
bodyAsString(String encoding) |
List<String> |
cookies() |
boolean |
equals(Object o) |
List<String> |
followedRedirects() |
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
|
int |
hashCode() |
MultiMap |
headers() |
static <T> HttpResponse<T> |
newInstance(HttpResponse arg) |
static <T> HttpResponse<T> |
newInstance(HttpResponse arg,
io.vertx.lang.rx.TypeArg<T> __typeArg_T) |
int |
statusCode() |
String |
statusMessage() |
String |
toString() |
MultiMap |
trailers() |
HttpVersion |
version() |
public static final io.vertx.lang.rx.TypeArg<HttpResponse> __TYPE_ARG
public final io.vertx.lang.rx.TypeArg<T> __typeArg_0
public HttpResponse(HttpResponse delegate)
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()
null
if a codec other than was usedpublic List<String> followedRedirects()
public String bodyAsString()
String
, or null
if a codec other than was usedpublic String bodyAsString(String encoding)
encoding
- String
given a specific encoding
, or null
if a codec other than was usedpublic JsonObject bodyAsJsonObject()
null
if a codec other than was usedpublic JsonArray bodyAsJsonArray()
null
if a codec other than was usedpublic <R> R bodyAsJson(Class<R> type)
type
- type
with the Jackson mapper, or null
if a codec other than was usedpublic static <T> HttpResponse<T> newInstance(HttpResponse arg)
public static <T> HttpResponse<T> newInstance(HttpResponse arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)
Copyright © 2024 Eclipse. All rights reserved.