trait WSResponse extends StandaloneWSResponse with WSBodyReadables
A WS Response that can use Play specific classes.
- Source
- WSResponse.scala
- Alphabetic
- By Inheritance
- WSResponse
- WSBodyReadables
- XMLBodyReadables
- JsonBodyReadables
- DefaultBodyReadables
- StandaloneWSResponse
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
body: String
The response body as String.
The response body as String.
- Definition Classes
- WSResponse → StandaloneWSResponse
-
abstract
def
bodyAsBytes: ByteString
The response body as a byte string.
The response body as a byte string.
- Definition Classes
- WSResponse → StandaloneWSResponse
-
abstract
def
bodyAsSource: Source[ByteString, _]
- Definition Classes
- WSResponse → StandaloneWSResponse
-
abstract
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
-
abstract
def
cookies: Seq[WSCookie]
Get all the cookies.
Get all the cookies.
- Definition Classes
- WSResponse → StandaloneWSResponse
-
abstract
def
headers: Map[String, Seq[String]]
Return the current headers for this response.
Return the current headers for this response.
- Definition Classes
- WSResponse → StandaloneWSResponse
- abstract def json: JsValue
-
abstract
def
status: Int
The response status code.
The response status code.
- Definition Classes
- WSResponse → StandaloneWSResponse
-
abstract
def
statusText: String
The response status message.
The response status message.
- Definition Classes
- WSResponse → StandaloneWSResponse
-
abstract
def
underlying[T]: T
Get the underlying response object.
Get the underlying response object.
- Definition Classes
- WSResponse → StandaloneWSResponse
-
abstract
def
uri: URI
- Definition Classes
- StandaloneWSResponse
- abstract def xml: Elem
-
abstract
def
allHeaders: Map[String, Seq[String]]
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Use response.headers
Concrete 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[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
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
contentType: String
- Definition Classes
- WSResponse → StandaloneWSResponse
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
header(name: String): Option[String]
- Definition Classes
- WSResponse → StandaloneWSResponse
-
def
headerValues(name: String): Seq[String]
- Definition Classes
- 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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )