c

play.api.libs.ws.ahc

AhcWSResponse

case class AhcWSResponse(underlying: StandaloneWSResponse) extends WSResponse with WSBodyReadables with Product with Serializable

A WS HTTP Response backed by an AsyncHttpClient response.

underlying

the underlying WS response

Source
AhcWSResponse.scala
Linear Supertypes
Serializable, Product, Equals, WSResponse, WSBodyReadables, XMLBodyReadables, JsonBodyReadables, DefaultBodyReadables, StandaloneWSResponse, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AhcWSResponse
  2. Serializable
  3. Product
  4. Equals
  5. WSResponse
  6. WSBodyReadables
  7. XMLBodyReadables
  8. JsonBodyReadables
  9. DefaultBodyReadables
  10. StandaloneWSResponse
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new AhcWSResponse(ahcResponse: Response)
  2. new AhcWSResponse(underlying: StandaloneWSResponse)

    underlying

    the underlying WS response

Value Members

  1. def body: String

    The response body as String.

    The response body as String.

    Definition Classes
    WSResponse → StandaloneWSResponse
  2. 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
  3. def bodyAsBytes: ByteString

    The response body as a byte string.

    The response body as a byte string.

    Definition Classes
    WSResponse → StandaloneWSResponse
  4. def bodyAsSource: Source[ByteString, _]
    Definition Classes
    WSResponse → StandaloneWSResponse
  5. def contentType: String
    Definition Classes
    WSResponse → StandaloneWSResponse
  6. 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
  7. def cookies: Seq[WSCookie]

    Get all the cookies.

    Get all the cookies.

    Definition Classes
    WSResponse → StandaloneWSResponse
  8. def header(key: String): Option[String]

    Get a response header.

    Get a response header.

    Definition Classes
    WSResponse → StandaloneWSResponse
  9. def headerValues(name: String): Seq[String]
    Definition Classes
    WSResponse → StandaloneWSResponse
  10. 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
  11. def productElementNames: Iterator[String]
    Definition Classes
    Product
  12. implicit val readableAsByteArray: BodyReadable[Array[Byte]]
    Definition Classes
    DefaultBodyReadables
  13. implicit val readableAsByteBuffer: BodyReadable[ByteBuffer]
    Definition Classes
    DefaultBodyReadables
  14. implicit val readableAsByteString: BodyReadable[ByteString]
    Definition Classes
    DefaultBodyReadables
  15. implicit val readableAsJson: BodyReadable[JsValue]
    Definition Classes
    JsonBodyReadables
  16. implicit val readableAsSource: BodyReadable[Source[ByteString, _]]
    Definition Classes
    DefaultBodyReadables
  17. implicit val readableAsString: BodyReadable[String]
    Definition Classes
    DefaultBodyReadables
  18. implicit val readableAsXml: BodyReadable[Elem]
    Definition Classes
    XMLBodyReadables
  19. def status: Int

    The response status code.

    The response status code.

    Definition Classes
    WSResponse → StandaloneWSResponse
  20. def statusText: String

    The response status message.

    The response status message.

    Definition Classes
    WSResponse → StandaloneWSResponse
  21. 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
  22. val underlying: StandaloneWSResponse
  23. def uri: URI
    Definition Classes
    AhcWSResponse → StandaloneWSResponse

Deprecated Value Members

  1. 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

  2. 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]

  3. 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]