The response body as String.
The response body as String.
The response body as a byte string.
The response body as a byte string.
Get only one cookie, using the cookie name.
Get only one cookie, using the cookie name.
Get all the cookies.
Get all the cookies.
Return the current headers for this response.
Return the current headers for this response.
The response status code.
The response status code.
The response status message.
The response status message.
Get the underlying response object.
Get the underlying response object.
(Since version 2.6.0) Use response.headers
The response body as the given type.
The response body as the given type. This renders as the given type. You must have a BodyReadable in implicit scope, which is done with
class MyClass extends play.api.libs.ws.WSBodyReadables { // JSON and XML body readables }
The simplest use case is
val responseBodyAsString: String = response.getBody[String]
But you can also render as JSON
val responseBodyAsJson: JsValue = response.getBody[JsValue]
or as XML:
val xml: Elem = response.getBody[Elem]
A WS Response that can use Play specific classes.