Package io.vertx.mutiny.ext.web.client
Class HttpResponse<T>
java.lang.Object
io.vertx.mutiny.ext.web.client.HttpResponse<T>
- All Implemented Interfaces:
MutinyDelegate,HttpResponseHead
An HTTP response.
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.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Julien Viet
- See Also:
-
HttpResponse
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.http.HttpResponseHead
HttpResponseHead.HttpResponseHeadImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpResponse(io.vertx.ext.web.client.HttpResponse<T> delegate) Create a new instance ofHttpResponsedelegating to the given (non-null) instance ofHttpResponse.HttpResponse(io.vertx.ext.web.client.HttpResponse<T> delegate, TypeArg<T> typeArg_0) HttpResponse(Object delegate, TypeArg<T> typeArg_0) -
Method Summary
Modifier and TypeMethodDescriptionbody()io.vertx.core.buffer.Buffer<R> RbodyAsJson(Class<R> type) io.vertx.core.json.JsonArrayio.vertx.core.json.JsonObjectbodyAsString(String encoding) cookies()booleanio.vertx.ext.web.client.HttpResponse<T>Get the delegate instance.getHeader(CharSequence headerName) Return the first header value with the specified nameReturn the first header value with the specified namegetTrailer(String trailerName) Return the first trailer value with the specified nameinthashCode()io.vertx.core.MultiMapheaders()static <T> HttpResponse<T>newInstance(io.vertx.ext.web.client.HttpResponse<T> delegate) Creates a new instance of theHttpResponse.static <T> HttpResponse<T>newInstance(io.vertx.ext.web.client.HttpResponse<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theHttpResponse.inttoString()io.vertx.core.MultiMaptrailers()io.vertx.core.http.HttpVersionversion()
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
HttpResponse
Create a new instance ofHttpResponsedelegating to the given (non-null) instance ofHttpResponse. -
HttpResponse
-
HttpResponse
-
-
Method Details
-
getDelegate
Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceHttpResponseHead- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
trailers
public io.vertx.core.MultiMap trailers()- Returns:
- the trailers
-
getTrailer
Return the first trailer value with the specified name- Parameters:
trailerName- the trailer name- Returns:
- the trailer value. Can be
null.
-
body
- Returns:
- the response body in the format it was decoded. Can be
null.
-
bodyAsBuffer
public io.vertx.core.buffer.Buffer bodyAsBuffer()- Returns:
- the response body decoded as a
Buffer, ornullif a codec other thanBodyCodec#buffer()was used
-
followedRedirects
- Returns:
- the list of all followed redirects, including the final location.
-
bodyAsString
- Returns:
- the response body decoded as a
String, ornullif a codec other thanBodyCodec#buffer()was used
-
bodyAsString
- Returns:
- the response body decoded as a
Stringgiven a specificencoding, ornullif a codec other thanBodyCodec#buffer()was used
-
bodyAsJsonObject
public io.vertx.core.json.JsonObject bodyAsJsonObject()- Returns:
- the response body decoded as
JsonObject, ornullif a codec other thanBodyCodec#buffer()was used
-
bodyAsJsonArray
public io.vertx.core.json.JsonArray bodyAsJsonArray()- Returns:
- the response body decoded as a
JsonArray, ornullif a codec other thanBodyCodec#buffer()was used
-
bodyAsJson
- Returns:
- the response body decoded as the specified
typewith the Jackson mapper, ornullif a codec other thanBodyCodec#buffer()was used
-
headers
public io.vertx.core.MultiMap headers()- Specified by:
headersin interfaceHttpResponseHead- Returns:
- the headers
-
statusCode
public int statusCode()- Specified by:
statusCodein interfaceHttpResponseHead- Returns:
- the status code of the response
-
getHeader
Return the first header value with the specified name- Specified by:
getHeaderin interfaceHttpResponseHead- Parameters:
headerName- the header name- Returns:
- the header value. Can be
null.
-
statusMessage
- Specified by:
statusMessagein interfaceHttpResponseHead- Returns:
- the status message of the response
-
version
public io.vertx.core.http.HttpVersion version()- Specified by:
versionin interfaceHttpResponseHead- Returns:
- the version of the response
-
getHeader
Return the first header value with the specified name- Specified by:
getHeaderin interfaceHttpResponseHead- Parameters:
headerName- the header name- Returns:
- the header value
-
cookies
- Specified by:
cookiesin interfaceHttpResponseHead- Returns:
- the Set-Cookie headers (including trailers)
-
newInstance
Creates a new instance of theHttpResponse. -
newInstance
public static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theHttpResponse. -
hashCode
public int hashCode() -
equals
-
toString
-