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
- Alphabetic
- By Inheritance
- AhcWSResponse
- Serializable
- Serializable
- Product
- Equals
- WSResponse
- WSBodyReadables
- XMLBodyReadables
- JsonBodyReadables
- DefaultBodyReadables
- StandaloneWSResponse
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
body: String
The response body as String.
The response body as String.
- Definition Classes
- AhcWSResponse → 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.getBody[String]
But you can also render as JSON
val responseBodyAsJson: JsValue = response.getBody[JsValue]
or as XML:
val xml: Elem = response.getBody[Elem]
- Definition Classes
- WSResponse → StandaloneWSResponse
-
def
bodyAsBytes: ByteString
The response body as a byte string.
The response body as a byte string.
- Definition Classes
- AhcWSResponse → WSResponse → StandaloneWSResponse
-
def
bodyAsSource: Source[ByteString, _]
- Definition Classes
- AhcWSResponse → WSResponse → StandaloneWSResponse
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
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
- AhcWSResponse → WSResponse → StandaloneWSResponse
-
def
cookies: Seq[WSCookie]
Get all the cookies.
Get all the cookies.
- Definition Classes
- AhcWSResponse → WSResponse → StandaloneWSResponse
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
header(key: String): Option[String]
Get a response header.
Get a response header.
- Definition Classes
- AhcWSResponse → 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
- AhcWSResponse → WSResponse → StandaloneWSResponse
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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
- AhcWSResponse → WSResponse → StandaloneWSResponse
-
def
statusText: String
The response status message.
The response status message.
- Definition Classes
- AhcWSResponse → WSResponse → StandaloneWSResponse
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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
- AhcWSResponse → WSResponse → StandaloneWSResponse
- val underlying: StandaloneWSResponse
-
def
uri: URI
- Definition Classes
- AhcWSResponse → StandaloneWSResponse
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
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
- AhcWSResponse → 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
- AhcWSResponse → 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
- AhcWSResponse → WSResponse
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Use response.body[Elem]