public interface WSResponse
extends play.libs.ws.StandaloneWSResponse
Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray()
Gets the body as an array of bytes.
|
com.fasterxml.jackson.databind.JsonNode |
asJson()
Gets the body as JSON node.
|
Document |
asXml()
return the body as XML.
|
Map<String,List<String>> |
getAllHeaders()
Deprecated.
|
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
getBody(BodyReadable) with WSBodyWritables.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.
|
Map<String,List<String>> getHeaders()
getHeaders
in interface play.libs.ws.StandaloneWSResponse
List<String> getHeaderValues(String name)
getHeaderValues
in interface play.libs.ws.StandaloneWSResponse
Optional<String> getSingleHeader(String name)
getSingleHeader
in interface play.libs.ws.StandaloneWSResponse
@Deprecated Map<String,List<String>> getAllHeaders()
Object getUnderlying()
getUnderlying
in interface play.libs.ws.StandaloneWSResponse
String getContentType()
getContentType
in interface play.libs.ws.StandaloneWSResponse
int getStatus()
getStatus
in interface play.libs.ws.StandaloneWSResponse
String getStatusText()
getStatusText
in interface play.libs.ws.StandaloneWSResponse
List<play.libs.ws.WSCookie> getCookies()
getCookies
in interface play.libs.ws.StandaloneWSResponse
Optional<play.libs.ws.WSCookie> getCookie(String name)
getCookie
in interface play.libs.ws.StandaloneWSResponse
String getBody()
getBody
in interface play.libs.ws.StandaloneWSResponse
akka.util.ByteString getBodyAsBytes()
getBodyAsBytes
in interface play.libs.ws.StandaloneWSResponse
akka.stream.javadsl.Source<akka.util.ByteString,?> getBodyAsSource()
getBodyAsSource
in interface play.libs.ws.StandaloneWSResponse
<T> T getBody(play.libs.ws.BodyReadable<T> readable)
BodyReadable
.
See WSBodyReadables
for convenient functions.
getBody
in interface play.libs.ws.StandaloneWSResponse
T
- the type to return, i.e. String.readable
- a transformation function from a response to a T.Document asXml()
com.fasterxml.jackson.databind.JsonNode asJson()
@Deprecated InputStream getBodyAsStream()
getBody(BodyReadable)
with WSBodyWritables.inputStream()
.byte[] asByteArray()