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()
WSResponsegetUnderlying in interface WSResponsepublic int getStatus()
getStatus in interface WSResponsepublic java.lang.String getStatusText()
getStatusText in interface WSResponsepublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAllHeaders()
getAllHeaders in interface WSResponsepublic java.lang.String getHeader(java.lang.String key)
getHeader in interface WSResponsepublic java.util.List<WSCookie> getCookies()
getCookies in interface WSResponsepublic WSCookie getCookie(java.lang.String name)
getCookie in interface WSResponsepublic java.lang.String getBody()
WSResponsegetBody in interface WSResponsepublic org.w3c.dom.Document asXml()
DOM documentasXml in interface WSResponsepublic com.fasterxml.jackson.databind.JsonNode asJson()
JsonNodeasJson in interface WSResponsepublic java.io.InputStream getBodyAsStream()
getBodyAsStream in interface WSResponsepublic byte[] asByteArray()
asByteArray in interface WSResponsepublic 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 WSResponseURI.