public class AhcWSResponse extends 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()) |
Document |
asXml()
Deprecated.
Use
response.getBody(xml()) |
Map<String,List<String>> |
getAllHeaders()
Deprecated.
Deprecated since 2.6.0. Use
getHeaders() instead. |
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() |
InputStream |
getBodyAsStream()
Deprecated.
Use
response.getBody(inputStream()) |
String |
getContentType() |
Optional<play.libs.ws.WSCookie> |
getCookie(String name) |
List<play.libs.ws.WSCookie> |
getCookies() |
Map<String,List<String>> |
getHeaders() |
List<String> |
getHeaderValues(String name) |
Optional<String> |
getSingleHeader(String name) |
int |
getStatus() |
String |
getStatusText() |
Object |
getUnderlying()
Gets the underlying implementation response object, if any.
|
URI |
getUri() |
public Map<String,List<String>> getHeaders()
getHeaders in interface play.libs.ws.StandaloneWSResponsegetHeaders in interface WSResponsepublic List<String> getHeaderValues(String name)
getHeaderValues in interface play.libs.ws.StandaloneWSResponsegetHeaderValues in interface WSResponsepublic Optional<String> getSingleHeader(String name)
getSingleHeader in interface play.libs.ws.StandaloneWSResponsegetSingleHeader in interface WSResponsepublic Object getUnderlying()
WSResponsegetUnderlying in interface play.libs.ws.StandaloneWSResponsegetUnderlying in interface WSResponsepublic String getContentType()
getContentType in interface play.libs.ws.StandaloneWSResponsegetContentType in interface WSResponsepublic int getStatus()
getStatus in interface play.libs.ws.StandaloneWSResponsegetStatus in interface WSResponsepublic String getStatusText()
getStatusText in interface play.libs.ws.StandaloneWSResponsegetStatusText in interface WSResponsepublic List<play.libs.ws.WSCookie> getCookies()
getCookies in interface play.libs.ws.StandaloneWSResponsegetCookies in interface WSResponsepublic Optional<play.libs.ws.WSCookie> getCookie(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 String getBody()
getBody in interface play.libs.ws.StandaloneWSResponsegetBody in interface WSResponsepublic URI getUri()
getUri in interface play.libs.ws.StandaloneWSResponse@Deprecated public Map<String,List<String>> getAllHeaders()
getHeaders() instead.WSResponsegetAllHeaders in interface WSResponse@Deprecated public 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 InputStream getBodyAsStream()
response.getBody(inputStream())WSResponsegetBodyAsStream in interface WSResponse@Deprecated public byte[] asByteArray()
response.getBodyAsBytes().toArray()WSResponseasByteArray in interface WSResponse