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:
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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpResponse(io.vertx.ext.web.client.HttpResponse delegate) HttpResponse(io.vertx.ext.web.client.HttpResponse delegate, TypeArg<T> typeArg_0) HttpResponse(Object delegate, TypeArg<T> typeArg_0) -
Method Summary
Modifier and TypeMethodDescriptionbody()<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()headers()static <T> HttpResponse<T>newInstance(io.vertx.ext.web.client.HttpResponse arg) static <T> HttpResponse<T>newInstance(io.vertx.ext.web.client.HttpResponse arg, TypeArg<T> __typeArg_T) inttoString()trailers()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
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.client.HttpResponse getDelegate()- Specified by:
getDelegatein interfaceHttpResponseHead- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
version
public io.vertx.core.http.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
- Specified by:
statusMessagein interfaceHttpResponseHead- Returns:
- the status message of the response
-
headers
- Specified by:
headersin interfaceHttpResponseHead- Returns:
- the headers
-
getHeader
- Specified by:
getHeaderin interfaceHttpResponseHead- Parameters:
arg0- the header name- Returns:
- the header value
-
cookies
- Specified by:
cookiesin interfaceHttpResponseHead- Returns:
- the Set-Cookie headers (including trailers)
-
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
- 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 interfaceHttpResponseHead- Parameters:
arg0- the header name- Returns:
- the header value
-
newInstance
-
newInstance
public static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg, TypeArg<T> __typeArg_T)
-