DefaultBodyWritables

play.api.libs.ws.DefaultBodyWritables
See theDefaultBodyWritables companion object

Default BodyWritable for a request body, for use with requests that take a body such as PUT, POST and PATCH.

import scala.concurrent.ExecutionContext

import play.api.libs.ws.StandaloneWSClient
import play.api.libs.ws.DefaultBodyWritables._

class MyClass(ws: StandaloneWSClient) {
 def postBody()(implicit ec: ExecutionContext) = {
   val getBody: String = "..."
   ws.url("...").post(getBody).map { response => ??? }
 }
}

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Implicits

Implicits

implicit val writableOf_File: BodyWritable[File]

Creates an SourceBody with "application/octet-stream" content type from a file.

Creates an SourceBody with "application/octet-stream" content type from a file.

Attributes

implicit val writableOf_InputStream: BodyWritable[Supplier[InputStream]]

Creates an SourceBody with "application/octet-stream" content type from an inputstream.

Creates an SourceBody with "application/octet-stream" content type from an inputstream.

Attributes

implicit val writableOf_Source: BodyWritable[Source[ByteString, _]]

Creates an SourceBody with "application/octet-stream" content type from a file.

Creates an SourceBody with "application/octet-stream" content type from a file.

Attributes

implicit val writeableOf_ByteArray: BodyWritable[Array[Byte]]

Creates an InMemoryBody with "application/octet-stream" content type from an array of bytes.

Creates an InMemoryBody with "application/octet-stream" content type from an array of bytes.

Attributes

implicit val writeableOf_ByteBuffer: BodyWritable[ByteBuffer]

Creates an InMemoryBody with "application/octet-stream" content type from a bytebuffer.

Creates an InMemoryBody with "application/octet-stream" content type from a bytebuffer.

Attributes

implicit val writeableOf_Bytes: BodyWritable[ByteString]

Creates an InMemoryBody with "application/octet-stream" content type.

Creates an InMemoryBody with "application/octet-stream" content type.

Attributes

implicit val writeableOf_String: BodyWritable[String]

Creates an InMemoryBody with "text/plain" content type.

Creates an InMemoryBody with "text/plain" content type.

Attributes

implicit val writeableOf_StringBuilder: BodyWritable[StringBuilder]

Creates an InMemoryBody with "text/plain" content type from a StringBuilder

Creates an InMemoryBody with "text/plain" content type from a StringBuilder

Attributes

Creates a BodyWritable with an identity function, with "application/octet-stream" content type.

Creates a BodyWritable with an identity function, with "application/octet-stream" content type.

Attributes

implicit val writeableOf_urlEncodedForm: BodyWritable[Map[String, Seq[String]]]

Creates an InMemoryBody with "application/x-www-form-urlencoded" content type.

Creates an InMemoryBody with "application/x-www-form-urlencoded" content type.

Attributes

implicit val writeableOf_urlEncodedSimpleForm: BodyWritable[Map[String, String]]