Package io.vertx.mutiny.ext.web.client
Class HttpResponse<T>
java.lang.Object
io.vertx.mutiny.ext.web.client.HttpResponse<T>
- All Implemented Interfaces:
io.smallrye.mutiny.vertx.MutinyDelegate,io.vertx.mutiny.core.http.HttpResponseHead
public class HttpResponse<T>
extends Object
implements io.smallrye.mutiny.vertx.MutinyDelegate, io.vertx.mutiny.core.http.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 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 Mutiny-ified interface using Vert.x codegen.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.smallrye.mutiny.vertx.TypeArg<HttpResponse> final io.smallrye.mutiny.vertx.TypeArg<T> -
Constructor Summary
ConstructorsConstructorDescriptionHttpResponse(io.vertx.ext.web.client.HttpResponse delegate) HttpResponse(io.vertx.ext.web.client.HttpResponse delegate, io.smallrye.mutiny.vertx.TypeArg<T> typeArg_0) HttpResponse(Object delegate, io.smallrye.mutiny.vertx.TypeArg<T> typeArg_0) -
Method Summary
Modifier and TypeMethodDescriptionbody()io.vertx.mutiny.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.HttpResponsegetHeader(CharSequence arg0) getTrailer(String trailerName) inthashCode()io.vertx.mutiny.core.MultiMapheaders()static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg) static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg, io.smallrye.mutiny.vertx.TypeArg<T> __typeArg_T) inttoString()io.vertx.mutiny.core.MultiMaptrailers()io.vertx.core.http.HttpVersionversion()
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
HttpResponse
public HttpResponse(io.vertx.ext.web.client.HttpResponse delegate) -
HttpResponse
-
HttpResponse
public HttpResponse(io.vertx.ext.web.client.HttpResponse delegate, io.smallrye.mutiny.vertx.TypeArg<T> typeArg_0)
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.client.HttpResponse getDelegate()- Specified by:
getDelegatein interfaceio.vertx.mutiny.core.http.HttpResponseHead- Specified by:
getDelegatein interfaceio.smallrye.mutiny.vertx.MutinyDelegate
-
toString
-
equals
-
hashCode
public int hashCode() -
version
public io.vertx.core.http.HttpVersion version()- Specified by:
versionin interfaceio.vertx.mutiny.core.http.HttpResponseHead
-
statusCode
public int statusCode()- Specified by:
statusCodein interfaceio.vertx.mutiny.core.http.HttpResponseHead
-
statusMessage
- Specified by:
statusMessagein interfaceio.vertx.mutiny.core.http.HttpResponseHead
-
headers
public io.vertx.mutiny.core.MultiMap headers()- Specified by:
headersin interfaceio.vertx.mutiny.core.http.HttpResponseHead
-
getHeader
- Specified by:
getHeaderin interfaceio.vertx.mutiny.core.http.HttpResponseHead
-
cookies
- Specified by:
cookiesin interfaceio.vertx.mutiny.core.http.HttpResponseHead
-
trailers
public io.vertx.mutiny.core.MultiMap trailers()- Returns:
- the trailers
-
getTrailer
- Parameters:
trailerName- the trailer name- Returns:
- the trailer value
-
body
- Returns:
- the response body in the format it was decoded.
-
bodyAsBuffer
public io.vertx.mutiny.core.buffer.Buffer bodyAsBuffer()- Returns:
- the response body decoded as a , or
nullif a codec other than 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 than was used
-
bodyAsString
- Parameters:
encoding-- Returns:
- the response body decoded as a
Stringgiven a specificencoding, ornullif a codec other than was used
-
bodyAsJsonObject
public io.vertx.core.json.JsonObject bodyAsJsonObject()- Returns:
- the response body decoded as , or
nullif a codec other than was used
-
bodyAsJsonArray
public io.vertx.core.json.JsonArray bodyAsJsonArray()- Returns:
- the response body decoded as a , or
nullif a codec other than was used
-
bodyAsJson
- Parameters:
type-- Returns:
- the response body decoded as the specified
typewith the Jackson mapper, ornullif a codec other than was used
-
getHeader
- Specified by:
getHeaderin interfaceio.vertx.mutiny.core.http.HttpResponseHead
-
newInstance
-
newInstance
public static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg, io.smallrye.mutiny.vertx.TypeArg<T> __typeArg_T)
-