DefaultBodyReadables

play.api.libs.ws.DefaultBodyReadables
See theDefaultBodyReadables companion trait

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Implicits

Inherited implicits

implicit val readableAsByteArray: BodyReadable[Array[Byte]]

Converts a response body into Array[Byte].

Converts a response body into Array[Byte].

import play.api.libs.ws.DefaultBodyReadables._

def example(response: play.api.libs.ws.StandaloneWSResponse): Array[Byte] =
 response.body[Array[Byte]]

Attributes

Inherited from:
DefaultBodyReadables
implicit val readableAsByteBuffer: BodyReadable[ByteBuffer]

Converts a response body into a read only ByteBuffer.

Converts a response body into a read only ByteBuffer.

import java.nio.ByteBuffer
import play.api.libs.ws.DefaultBodyReadables._

def example(response: play.api.libs.ws.StandaloneWSResponse): ByteBuffer =
 response.body[ByteBuffer]

Attributes

Inherited from:
DefaultBodyReadables
implicit val readableAsByteString: BodyReadable[ByteString]

Converts a response body into an org.apache.pekko.util.ByteString:

Converts a response body into an org.apache.pekko.util.ByteString:

import org.apache.pekko.util.ByteString
import play.api.libs.ws.DefaultBodyReadables._

def example(response: play.api.libs.ws.StandaloneWSResponse): ByteString =
 response.body[ByteString]

Attributes

Inherited from:
DefaultBodyReadables
implicit val readableAsSource: BodyReadable[Source[ByteString, _]]

Converts a response body into Source[ByteString, _].

Converts a response body into Source[ByteString, _].

Attributes

Inherited from:
DefaultBodyReadables
implicit val readableAsString: BodyReadable[String]

Converts a response body into a String.

Converts a response body into a String.

Note: this is only a best-guess effort and does not handle all content types. See StandaloneWSResponse.body:String* for more information.

import play.api.libs.ws.DefaultBodyReadables._

def example(response: play.api.libs.ws.StandaloneWSResponse): String =
 response.body[String]

Attributes

Inherited from:
DefaultBodyReadables