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.StandaloneWSResponsegetHeaders in interface WSResponsepublic java.util.List<java.lang.String> getHeaderValues(java.lang.String name)
getHeaderValues in interface play.libs.ws.StandaloneWSResponsegetHeaderValues in interface WSResponsepublic java.util.Optional<java.lang.String> getSingleHeader(java.lang.String name)
getSingleHeader in interface play.libs.ws.StandaloneWSResponsegetSingleHeader in interface WSResponsepublic java.lang.Object getUnderlying()
WSResponsegetUnderlying in interface play.libs.ws.StandaloneWSResponsegetUnderlying in interface WSResponsepublic java.lang.String getContentType()
getContentType in interface play.libs.ws.StandaloneWSResponsegetContentType in interface WSResponsepublic int getStatus()
getStatus in interface play.libs.ws.StandaloneWSResponsegetStatus in interface WSResponsepublic java.lang.String getStatusText()
getStatusText in interface play.libs.ws.StandaloneWSResponsegetStatusText in interface WSResponsepublic java.util.List<play.libs.ws.WSCookie> getCookies()
getCookies in interface play.libs.ws.StandaloneWSResponsegetCookies in interface WSResponsepublic java.util.Optional<play.libs.ws.WSCookie> getCookie(java.lang.String name)
getCookie in interface play.libs.ws.StandaloneWSResponsegetCookie in interface WSResponsepublic akka.util.ByteString getBodyAsBytes()
getBodyAsBytes in interface play.libs.ws.StandaloneWSResponsegetBodyAsBytes in interface WSResponsepublic <T> T getBody(play.libs.ws.BodyReadable<T> readable)
WSResponseBodyReadable.
See WSBodyReadables for convenient functions.getBody in interface play.libs.ws.StandaloneWSResponsegetBody in interface WSResponseT - 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.StandaloneWSResponsegetBodyAsSource in interface WSResponsepublic java.lang.String getBody()
getBody in interface play.libs.ws.StandaloneWSResponsegetBody in interface WSResponsepublic 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.WSResponsegetAllHeaders in interface WSResponse@Deprecated public org.w3c.dom.Document asXml()
response.getBody(xml())WSResponseasXml in interface WSResponse@Deprecated public com.fasterxml.jackson.databind.JsonNode asJson()
response.getBody(json())WSResponseasJson in interface WSResponse@Deprecated public java.io.InputStream getBodyAsStream()
response.getBody(inputStream())WSResponsegetBodyAsStream in interface WSResponse@Deprecated public byte[] asByteArray()
response.getBodyAsBytes().toArray()WSResponseasByteArray in interface WSResponse