Class HttpResponse<T>
- java.lang.Object
-
- io.vertx.reactivex.ext.web.client.HttpResponse<T>
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate,HttpResponseHead
public class HttpResponse<T> extends Object implements io.vertx.lang.rx.RxDelegate, HttpResponseHead
An HTTP response.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 theBodyCodecthat built the response.Keep in mind that using this
HttpResponseimpose to fully buffer the response body and should be used for payload that can fit in memory.NOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<HttpResponse>__TYPE_ARGio.vertx.lang.rx.TypeArg<T>__typeArg_0
-
Constructor Summary
Constructors Constructor Description HttpResponse(HttpResponse delegate)HttpResponse(Object delegate, io.vertx.lang.rx.TypeArg<T> typeArg_0)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tbody()BufferbodyAsBuffer()<R> RbodyAsJson(Class<R> type)JsonArraybodyAsJsonArray()JsonObjectbodyAsJsonObject()StringbodyAsString()StringbodyAsString(String encoding)List<String>cookies()booleanequals(Object o)List<String>followedRedirects()HttpResponsegetDelegate()StringgetHeader(CharSequence headerName)Return the first header value with the specified nameStringgetHeader(String headerName)Return the first header value with the specified nameStringgetTrailer(String trailerName)Return the first trailer value with the specified nameinthashCode()MultiMapheaders()static <T> HttpResponse<T>newInstance(HttpResponse arg)static <T> HttpResponse<T>newInstance(HttpResponse arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)intstatusCode()StringstatusMessage()StringtoString()MultiMaptrailers()HttpVersionversion()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<HttpResponse> __TYPE_ARG
-
__typeArg_0
public final io.vertx.lang.rx.TypeArg<T> __typeArg_0
-
-
Constructor Detail
-
HttpResponse
public HttpResponse(HttpResponse delegate)
-
-
Method Detail
-
getDelegate
public HttpResponse getDelegate()
- Specified by:
getDelegatein interfaceHttpResponseHead- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
version
public HttpVersion version()
- Specified by:
versionin interfaceHttpResponseHead- Returns:
- the version of the response
-
statusCode
public int statusCode()
- Specified by:
statusCodein interfaceHttpResponseHead- Returns:
- the status code of the response
-
statusMessage
public String statusMessage()
- Specified by:
statusMessagein interfaceHttpResponseHead- Returns:
- the status message of the response
-
headers
public MultiMap headers()
- Specified by:
headersin interfaceHttpResponseHead- Returns:
- the headers
-
getHeader
public String getHeader(String headerName)
Return the first header value with the specified name- Specified by:
getHeaderin interfaceHttpResponseHead- Parameters:
headerName- the header name- Returns:
- the header value
-
cookies
public List<String> cookies()
- Specified by:
cookiesin interfaceHttpResponseHead- Returns:
- the Set-Cookie headers (including trailers)
-
trailers
public MultiMap trailers()
- Returns:
- the trailers
-
getTrailer
public String getTrailer(String trailerName)
Return the first trailer value with the specified name- Parameters:
trailerName- the trailer name- Returns:
- the trailer value
-
body
public T body()
- Returns:
- the response body in the format it was decoded.
-
bodyAsBuffer
public Buffer bodyAsBuffer()
- Returns:
- the response body decoded as a , or
nullif a codec other than was used
-
followedRedirects
public List<String> followedRedirects()
- Returns:
- the list of all followed redirects, including the final location.
-
bodyAsString
public String bodyAsString()
- Returns:
- the response body decoded as a
String, ornullif a codec other than was used
-
bodyAsString
public String bodyAsString(String encoding)
- Parameters:
encoding-- Returns:
- the response body decoded as a
Stringgiven a specificencoding, ornullif a codec other than was used
-
bodyAsJsonObject
public JsonObject bodyAsJsonObject()
- Returns:
- the response body decoded as , or
nullif a codec other than was used
-
bodyAsJsonArray
public JsonArray bodyAsJsonArray()
- Returns:
- the response body decoded as a , or
nullif a codec other than was used
-
bodyAsJson
public <R> R bodyAsJson(Class<R> type)
- Parameters:
type-- Returns:
- the response body decoded as the specified
typewith the Jackson mapper, ornullif a codec other than was used
-
getHeader
public String getHeader(CharSequence headerName)
Return the first header value with the specified name- Parameters:
headerName- the header name- Returns:
- the header value
-
newInstance
public static <T> HttpResponse<T> newInstance(HttpResponse arg)
-
newInstance
public static <T> HttpResponse<T> newInstance(HttpResponse arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)
-
-