public class StandaloneAhcWSResponse extends java.lang.Object implements StandaloneWSResponse
Constructor and Description |
---|
StandaloneAhcWSResponse(play.shaded.ahc.org.asynchttpclient.Response ahcResponse) |
StandaloneAhcWSResponse(play.shaded.ahc.org.asynchttpclient.Response ahcResponse,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
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() |
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() |
java.net.URI |
getUri()
Return the request
URI . |
public StandaloneAhcWSResponse(play.shaded.ahc.org.asynchttpclient.Response ahcResponse, com.fasterxml.jackson.databind.ObjectMapper mapper)
public StandaloneAhcWSResponse(play.shaded.ahc.org.asynchttpclient.Response ahcResponse)
public java.lang.Object getUnderlying()
getUnderlying
in interface StandaloneWSResponse
public int getStatus()
getStatus
in interface StandaloneWSResponse
public java.lang.String getStatusText()
getStatusText
in interface StandaloneWSResponse
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAllHeaders()
getAllHeaders
in interface StandaloneWSResponse
public java.lang.String getHeader(java.lang.String key)
getHeader
in interface StandaloneWSResponse
key
- the header's namepublic java.util.List<WSCookie> getCookies()
getCookies
in interface StandaloneWSResponse
public WSCookie getCookie(java.lang.String name)
getCookie
in interface StandaloneWSResponse
name
- the cookie namepublic java.lang.String getBody()
getBody
in interface StandaloneWSResponse
public org.w3c.dom.Document asXml()
DOM document
asXml
in interface StandaloneWSResponse
public com.fasterxml.jackson.databind.JsonNode asJson()
JsonNode
asJson
in interface StandaloneWSResponse
public java.io.InputStream getBodyAsStream()
getBodyAsStream
in interface StandaloneWSResponse
public byte[] asByteArray()
asByteArray
in interface StandaloneWSResponse
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 StandaloneWSResponse
URI
.