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.StandaloneWSResponse
getHeaders
in interface WSResponse
public List<String> getHeaderValues(String name)
getHeaderValues
in interface play.libs.ws.StandaloneWSResponse
getHeaderValues
in interface WSResponse
public Optional<String> getSingleHeader(String name)
getSingleHeader
in interface play.libs.ws.StandaloneWSResponse
getSingleHeader
in interface WSResponse
public Object getUnderlying()
WSResponse
getUnderlying
in interface play.libs.ws.StandaloneWSResponse
getUnderlying
in interface WSResponse
public 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 String getStatusText()
getStatusText
in interface play.libs.ws.StandaloneWSResponse
getStatusText
in interface WSResponse
public List<play.libs.ws.WSCookie> getCookies()
getCookies
in interface play.libs.ws.StandaloneWSResponse
getCookies
in interface WSResponse
public Optional<play.libs.ws.WSCookie> getCookie(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 String getBody()
getBody
in interface play.libs.ws.StandaloneWSResponse
getBody
in interface WSResponse
public URI getUri()
getUri
in interface play.libs.ws.StandaloneWSResponse
@Deprecated public Map<String,List<String>> getAllHeaders()
getHeaders()
instead.WSResponse
getAllHeaders
in interface WSResponse
@Deprecated public 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 InputStream getBodyAsStream()
response.getBody(inputStream())
WSResponse
getBodyAsStream
in interface WSResponse
@Deprecated public byte[] asByteArray()
response.getBodyAsBytes().toArray()
WSResponse
asByteArray
in interface WSResponse