Package io.vertx.mutiny.ext.web.client
Class HttpResponse<T>
- java.lang.Object
-
- io.vertx.mutiny.ext.web.client.HttpResponse<T>
-
- All Implemented Interfaces:
HttpResponseHead
public class HttpResponse<T> extends Object implements 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 theBodyCodec
that built the response.Keep in mind that using this
NOTE: This class has been automatically generated from theHttpResponse
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 Modifier and Type Field Description static TypeArg<HttpResponse>
__TYPE_ARG
TypeArg<T>
__typeArg_0
-
Constructor Summary
Constructors Constructor Description HttpResponse(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
body()
Buffer
bodyAsBuffer()
<R> R
bodyAsJson(Class<R> type)
io.vertx.core.json.JsonArray
bodyAsJsonArray()
io.vertx.core.json.JsonObject
bodyAsJsonObject()
String
bodyAsString()
String
bodyAsString(String encoding)
List<String>
cookies()
boolean
equals(Object o)
List<String>
followedRedirects()
io.vertx.ext.web.client.HttpResponse
getDelegate()
String
getHeader(CharSequence arg0)
String
getHeader(String arg0)
String
getTrailer(String trailerName)
int
hashCode()
MultiMap
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
statusCode()
String
statusMessage()
String
toString()
MultiMap
trailers()
io.vertx.core.http.HttpVersion
version()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<HttpResponse> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.client.HttpResponse getDelegate()
- Specified by:
getDelegate
in interfaceHttpResponseHead
-
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
public String statusMessage()
- Specified by:
statusMessage
in interfaceHttpResponseHead
- Returns:
- the status message of the response
-
headers
public MultiMap headers()
- Specified by:
headers
in interfaceHttpResponseHead
- Returns:
- the headers
-
getHeader
public String getHeader(String arg0)
- Specified by:
getHeader
in interfaceHttpResponseHead
- Parameters:
arg0
- the header name- Returns:
- the header value
-
cookies
public List<String> cookies()
- Specified by:
cookies
in interfaceHttpResponseHead
- Returns:
- the Set-Cookie headers (including trailers)
-
trailers
public MultiMap trailers()
- Returns:
- the trailers
-
getTrailer
public String getTrailer(String trailerName)
- 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
null
if 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
, ornull
if a codec other than was used
-
bodyAsString
public String bodyAsString(String encoding)
- 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
public <R> R bodyAsJson(Class<R> type)
- Parameters:
type
-- Returns:
- the response body decoded as the specified
type
with the Jackson mapper, ornull
if a codec other than was used
-
getHeader
public String getHeader(CharSequence arg0)
- Specified by:
getHeader
in interfaceHttpResponseHead
- Parameters:
arg0
- the header name- Returns:
- the header value
-
newInstance
public static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg)
-
newInstance
public static <T> HttpResponse<T> newInstance(io.vertx.ext.web.client.HttpResponse arg, TypeArg<T> __typeArg_T)
-
-