public static class WS.Response
extends java.lang.Object
Constructor and Description |
---|
WS.Response(com.ning.http.client.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.lang.String |
getBody()
Get the response body as a string.
|
java.io.InputStream |
getBodyAsStream()
Get the response body as a stream
|
WS.Cookie |
getCookie(java.lang.String name)
Get only one cookie, using the cookie name.
|
java.util.List<WS.Cookie> |
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.net.URI |
getUri()
Return the request
URI . |
public int getStatus()
public java.lang.String getStatusText()
public java.lang.String getHeader(java.lang.String key)
public java.util.List<WS.Cookie> getCookies()
public WS.Cookie getCookie(java.lang.String name)
public java.lang.String getBody()
public org.w3c.dom.Document asXml()
DOM document
public com.fasterxml.jackson.databind.JsonNode asJson()
JsonNode
public java.io.InputStream getBodyAsStream()
public byte[] asByteArray()
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.URI
.