case class AhcWSResponse(underlying: StandaloneWSResponse) extends WSResponse with WSBodyReadables with Product with Serializable
- Alphabetic
- By Inheritance
- AhcWSResponse
- Serializable
- Product
- Equals
- WSResponse
- WSBodyReadables
- XMLBodyReadables
- JsonBodyReadables
- DefaultBodyReadables
- StandaloneWSResponse
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- def body: String
The response body as String.
The response body as String.
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def body[T](implicit arg0: BodyReadable[T]): T
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.body[String]
But you can also render as JSON
val responseBodyAsJson: JsValue = response.body[JsValue]
or as XML:
val xml: Elem = response.body[Elem]
- Definition Classes
- WSResponse → StandaloneWSResponse
- def bodyAsBytes: ByteString
The response body as a byte string.
The response body as a byte string.
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def bodyAsSource: Source[ByteString, _]
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def contentType: String
- Definition Classes
- WSResponse → StandaloneWSResponse
- def cookie(name: String): Option[WSCookie]
Get only one cookie, using the cookie name.
Get only one cookie, using the cookie name.
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def cookies: Seq[WSCookie]
Get all the cookies.
Get all the cookies.
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def header(key: String): Option[String]
Get a response header.
Get a response header.
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def headerValues(name: String): Seq[String]
- Definition Classes
- WSResponse → StandaloneWSResponse
- def headers: Map[String, Seq[String]]
Return the current headers of the request being constructed
Return the current headers of the request being constructed
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- implicit val readableAsByteArray: BodyReadable[Array[Byte]]
- Definition Classes
- DefaultBodyReadables
- implicit val readableAsByteBuffer: BodyReadable[ByteBuffer]
- Definition Classes
- DefaultBodyReadables
- implicit val readableAsByteString: BodyReadable[ByteString]
- Definition Classes
- DefaultBodyReadables
- implicit val readableAsJson: BodyReadable[JsValue]
- Definition Classes
- JsonBodyReadables
- implicit val readableAsSource: BodyReadable[Source[ByteString, _]]
- Definition Classes
- DefaultBodyReadables
- implicit val readableAsString: BodyReadable[String]
- Definition Classes
- DefaultBodyReadables
- implicit val readableAsXml: BodyReadable[Elem]
- Definition Classes
- XMLBodyReadables
- def status: Int
The response status code.
The response status code.
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def statusText: String
The response status message.
The response status message.
- Definition Classes
- → WSResponse → StandaloneWSResponse
- def underlying[T]: T
Get the underlying response object, i.e.
Get the underlying response object, i.e. play.shaded.ahc.org.asynchttpclient.Response
val ahcResponse = response.underlying[play.shaded.ahc.org.asynchttpclient.Response]
- Definition Classes
- → WSResponse → StandaloneWSResponse
- val underlying: StandaloneWSResponse
- def uri: URI
- Definition Classes
- AhcWSResponse → StandaloneWSResponse
Deprecated Value Members
- def allHeaders: Map[String, Seq[String]]
Return the current headers of the request being constructed
Return the current headers of the request being constructed
- Definition Classes
- → WSResponse
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Please use request.headers
- def json: JsValue
The response body as Json.
The response body as Json.
- Definition Classes
- → WSResponse
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Use response.body[JsValue]
- def xml: Elem
The response body as Xml.
The response body as Xml.
- Definition Classes
- → WSResponse
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Use response.body[Elem]
A WS HTTP Response backed by an AsyncHttpClient response.
the underlying WS response