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> R
bodyAsJson
(Class<R> type) io.vertx.core.json.JsonArray
io.vertx.core.json.JsonObject
bodyAsString
(String encoding) cookies()
boolean
io.vertx.ext.web.client.HttpResponse
getHeader
(CharSequence arg0) getTrailer
(String trailerName) int
hashCode()
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) int
toString()
trailers()
io.vertx.core.http.HttpVersion
version()
-
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:
getDelegate
in interfaceHttpResponseHead
- Specified by:
getDelegate
in 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:
version
in interfaceHttpResponseHead
- Returns:
- the version of the response
-
statusCode
public int statusCode()- Specified by:
statusCode
in interfaceHttpResponseHead
- Returns:
- the status code of the response
-
statusMessage
- Specified by:
statusMessage
in interfaceHttpResponseHead
- Returns:
- the status message of the response
-
headers
- Specified by:
headers
in interfaceHttpResponseHead
- Returns:
- the headers
-
getHeader
- Specified by:
getHeader
in interfaceHttpResponseHead
- Parameters:
arg0
- the header name- Returns:
- the header value
-
cookies
- Specified by:
cookies
in 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
null
if 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
, ornull
if a codec other than was used
-
bodyAsString
- Parameters:
encoding
-- Returns:
- the response body decoded as a
String
given a specificencoding
, ornull
if a codec other than was used
-
bodyAsJsonObject
public io.vertx.core.json.JsonObject bodyAsJsonObject()- Returns:
- the response body decoded as , or
null
if a codec other than was used
-
bodyAsJsonArray
public io.vertx.core.json.JsonArray bodyAsJsonArray()- Returns:
- the response body decoded as a , or
null
if a codec other than was used
-
bodyAsJson
- Parameters:
type
-- Returns:
- the response body decoded as the specified
type
with the Jackson mapper, ornull
if a codec other than was used
-
getHeader
- Specified by:
getHeader
in 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)
-