public class AhcWSResponse extends java.lang.Object implements WSResponse
Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray()
Deprecated.
Use
response.getBodyAsBytes().toArray() |
com.fasterxml.jackson.databind.JsonNode |
asJson()
Deprecated.
Use
response.getBody(json()) |
org.w3c.dom.Document |
asXml()
Deprecated.
Use
response.getBody(xml()) |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getAllHeaders()
Deprecated.
Deprecated since 2.6.0. Use
getHeaders() instead. |
java.lang.String |
getBody() |
<T> T |
getBody(play.libs.ws.BodyReadable<T> readable)
Gets the body of the response as a T, using a
BodyReadable . |
akka.util.ByteString |
getBodyAsBytes() |
akka.stream.javadsl.Source<akka.util.ByteString,?> |
getBodyAsSource() |
java.io.InputStream |
getBodyAsStream()
Deprecated.
Use
response.getBody(inputStream()) |
java.lang.String |
getContentType() |
java.util.Optional<play.libs.ws.WSCookie> |
getCookie(java.lang.String name) |
java.util.List<play.libs.ws.WSCookie> |
getCookies() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHeaders() |
java.util.List<java.lang.String> |
getHeaderValues(java.lang.String name) |
java.util.Optional<java.lang.String> |
getSingleHeader(java.lang.String name) |
int |
getStatus() |
java.lang.String |
getStatusText() |
java.lang.Object |
getUnderlying()
Gets the underlying implementation response object, if any.
|
java.net.URI |
getUri() |
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
getHeaders
in interface play.libs.ws.StandaloneWSResponse
getHeaders
in interface WSResponse
public java.util.List<java.lang.String> getHeaderValues(java.lang.String name)
getHeaderValues
in interface play.libs.ws.StandaloneWSResponse
getHeaderValues
in interface WSResponse
public java.util.Optional<java.lang.String> getSingleHeader(java.lang.String name)
getSingleHeader
in interface play.libs.ws.StandaloneWSResponse
getSingleHeader
in interface WSResponse
public java.lang.Object getUnderlying()
WSResponse
getUnderlying
in interface play.libs.ws.StandaloneWSResponse
getUnderlying
in interface WSResponse
public java.lang.String getContentType()
getContentType
in interface play.libs.ws.StandaloneWSResponse
getContentType
in interface WSResponse
public int getStatus()
getStatus
in interface play.libs.ws.StandaloneWSResponse
getStatus
in interface WSResponse
public java.lang.String getStatusText()
getStatusText
in interface play.libs.ws.StandaloneWSResponse
getStatusText
in interface WSResponse
public java.util.List<play.libs.ws.WSCookie> getCookies()
getCookies
in interface play.libs.ws.StandaloneWSResponse
getCookies
in interface WSResponse
public java.util.Optional<play.libs.ws.WSCookie> getCookie(java.lang.String name)
getCookie
in interface play.libs.ws.StandaloneWSResponse
getCookie
in interface WSResponse
public akka.util.ByteString getBodyAsBytes()
getBodyAsBytes
in interface play.libs.ws.StandaloneWSResponse
getBodyAsBytes
in interface WSResponse
public <T> T getBody(play.libs.ws.BodyReadable<T> readable)
WSResponse
BodyReadable
.
See WSBodyReadables
for convenient functions.
getBody
in interface play.libs.ws.StandaloneWSResponse
getBody
in interface WSResponse
T
- the type to return, i.e. String.readable
- a transformation function from a response to a T.public akka.stream.javadsl.Source<akka.util.ByteString,?> getBodyAsSource()
getBodyAsSource
in interface play.libs.ws.StandaloneWSResponse
getBodyAsSource
in interface WSResponse
public java.lang.String getBody()
getBody
in interface play.libs.ws.StandaloneWSResponse
getBody
in interface WSResponse
public java.net.URI getUri()
getUri
in interface play.libs.ws.StandaloneWSResponse
@Deprecated public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAllHeaders()
getHeaders()
instead.WSResponse
getAllHeaders
in interface WSResponse
@Deprecated public org.w3c.dom.Document asXml()
response.getBody(xml())
WSResponse
asXml
in interface WSResponse
@Deprecated public com.fasterxml.jackson.databind.JsonNode asJson()
response.getBody(json())
WSResponse
asJson
in interface WSResponse
@Deprecated public java.io.InputStream getBodyAsStream()
response.getBody(inputStream())
WSResponse
getBodyAsStream
in interface WSResponse
@Deprecated public byte[] asByteArray()
response.getBodyAsBytes().toArray()
WSResponse
asByteArray
in interface WSResponse