public class AhcWSResponse extends java.lang.Object implements WSResponse
Constructor and Description |
---|
AhcWSResponse(org.asynchttpclient.Response ahcResponse) |
Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray()
Get the response body as a byte array
|
com.fasterxml.jackson.databind.JsonNode |
asJson()
Get the response body as a
JsonNode |
org.w3c.dom.Document |
asXml()
Get the response body as a
DOM document |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getAllHeaders()
Get all the HTTP headers of the response as a case-insensitive map
|
java.lang.String |
getBody()
Gets the body as a string.
|
java.io.InputStream |
getBodyAsStream()
Get the response body as a stream
|
WSCookie |
getCookie(java.lang.String name)
Get only one cookie, using the cookie name.
|
java.util.List<WSCookie> |
getCookies()
Get all the cookies.
|
java.lang.String |
getHeader(java.lang.String key)
Get the given HTTP header of the response
|
int |
getStatus()
Get the HTTP status code of the response
|
java.lang.String |
getStatusText()
Get the HTTP status text of the response
|
java.lang.Object |
getUnderlying()
Gets the underlying implementation response object, if any.
|
java.net.URI |
getUri()
Return the request
URI . |
public java.lang.Object getUnderlying()
WSResponse
getUnderlying
in interface WSResponse
public int getStatus()
getStatus
in interface WSResponse
public java.lang.String getStatusText()
getStatusText
in interface WSResponse
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAllHeaders()
getAllHeaders
in interface WSResponse
public java.lang.String getHeader(java.lang.String key)
getHeader
in interface WSResponse
public java.util.List<WSCookie> getCookies()
getCookies
in interface WSResponse
public WSCookie getCookie(java.lang.String name)
getCookie
in interface WSResponse
public java.lang.String getBody()
WSResponse
getBody
in interface WSResponse
public org.w3c.dom.Document asXml()
DOM document
asXml
in interface WSResponse
public com.fasterxml.jackson.databind.JsonNode asJson()
JsonNode
asJson
in interface WSResponse
public java.io.InputStream getBodyAsStream()
getBodyAsStream
in interface WSResponse
public byte[] asByteArray()
asByteArray
in interface WSResponse
public java.net.URI getUri()
URI
. Note that if the request got redirected, the value of the
URI
will be the last valid redirect url.getUri
in interface WSResponse
URI
.