Package

play.api.libs

ws

Permalink

package ws

Provides type class BodyReadables and BodyWritables when you import the package object.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ws
  2. DefaultBodyWritables
  3. DefaultBodyReadables
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class BodyReadable[+R] extends AnyRef

    Permalink
    Annotations
    @implicitNotFound( ... )
  2. class BodyWritable[-A] extends AnyRef

    Permalink

    This is a type class pattern for writing different types of bodies to a WS request.

    This is a type class pattern for writing different types of bodies to a WS request.

    Annotations
    @implicitNotFound( ... )
  3. trait DefaultBodyReadables extends AnyRef

    Permalink

    Defines common BodyReadable for a response backed by org.asynchttpclient.Response.

  4. trait DefaultBodyWritables extends AnyRef

    Permalink

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

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

    class MyClass extends DefaultBodyWritables {
      def postBody() = {
        val getBody: String = ...
        ws.url(...).post(getBody).map { response => ... }
      }
    }
  5. case class DefaultWSCookie(name: String, value: String, domain: Option[String] = None, path: Option[String] = None, maxAge: Option[Long] = None, secure: Boolean = false, httpOnly: Boolean = false) extends WSCookie with Product with Serializable

    Permalink
  6. case class DefaultWSProxyServer(host: String, port: Int, protocol: Option[String] = None, principal: Option[String] = None, password: Option[String] = None, ntlmDomain: Option[String] = None, encoding: Option[String] = None, nonProxyHosts: Option[Seq[String]] = None) extends WSProxyServer with Product with Serializable

    Permalink

    A WS proxy.

  7. case class InMemoryBody(bytes: ByteString) extends WSBody with Product with Serializable

    Permalink

    An in memory body

    An in memory body

    bytes

    The bytes of the body

  8. case class SourceBody(source: Source[ByteString, _]) extends WSBody with Product with Serializable

    Permalink

    A body containing a source of bytes

    A body containing a source of bytes

    source

    A flow of the bytes of the body

  9. trait StandaloneWSClient extends Closeable

    Permalink

    The WSClient holds the configuration information needed to build a request, and provides a way to get a request holder.

  10. trait StandaloneWSRequest extends AnyRef

    Permalink

    A WS Request builder.

  11. trait StandaloneWSResponse extends AnyRef

    Permalink

    A WS HTTP response.

  12. trait WSAuthScheme extends AnyRef

    Permalink

  13. sealed trait WSBody extends AnyRef

    Permalink

    A body for the request.

  14. case class WSClientConfig(connectionTimeout: Duration = 2.minutes, idleTimeout: Duration = 2.minutes, requestTimeout: Duration = 2.minutes, followRedirects: Boolean = true, useProxyProperties: Boolean = true, userAgent: Option[String] = None, compressionEnabled: Boolean = false, ssl: SSLConfigSettings = SSLConfigSettings()) extends Product with Serializable

    Permalink

    WS client config

    WS client config

    connectionTimeout

    The maximum time to wait when connecting to the remote host (default is 120 seconds).

    idleTimeout

    The maximum time the request can stay idle (connection is established but waiting for more data) (default is 120 seconds).

    requestTimeout

    The total time you accept a request to take (it will be interrupted even if the remote host is still sending data) (default is 120 seconds).

    followRedirects

    Configures the client to follow 301 and 302 redirects (default is true).

    useProxyProperties

    To use the JVM system’s HTTP proxy settings (http.proxyHost, http.proxyPort) (default is true).

    userAgent

    To configure the User-Agent header field (default is None).

    compressionEnabled

    Set it to true to use gzip/deflater encoding (default is false).

    ssl

    use custom SSL / TLS configuration, see https://typesafehub.github.io/ssl-config/ for documentation.

  15. class WSConfigParser extends Provider[WSClientConfig]

    Permalink

    This class creates a WSClientConfig object from a Typesafe Config object.

    This class creates a WSClientConfig object from a Typesafe Config object.

    You can create a client config from an application.conf file by running

    val wsClientConfig = new WSConfigParser(ConfigFactory.load(), this.classLoader).parse()
    Annotations
    @Singleton()
  16. trait WSCookie extends AnyRef

    Permalink

    A WS Cookie.

  17. trait WSProxyServer extends AnyRef

    Permalink

    A WS proxy.

  18. trait WSRequestExecutor extends (StandaloneWSRequest) ⇒ Future[StandaloneWSResponse]

    Permalink
  19. trait WSRequestFilter extends (WSRequestExecutor) ⇒ WSRequestExecutor

    Permalink

    A request filter.

    A request filter. Override this trait to implement your own filters:

    class HeaderAppendingFilter(key: String, value: String) extends WSRequestFilter {
      override def apply(executor: WSRequestExecutor): WSRequestExecutor = {
        WSRequestExecutor(r => executor(r.withHeaders((key, value))))
      }
    }
  20. trait WSSignatureCalculator extends AnyRef

    Permalink

    Sign a WS call with OAuth.

Value Members

  1. object BodyReadable

    Permalink
  2. object BodyWritable

    Permalink
  3. object DefaultBodyReadables extends DefaultBodyReadables

    Permalink
  4. object DefaultBodyWritables extends DefaultBodyWritables

    Permalink
  5. object EmptyBody extends WSBody with Product with Serializable

    Permalink
  6. object WSAuthScheme

    Permalink
  7. object WSRequestExecutor

    Permalink
  8. object WSRequestFilter

    Permalink
  9. implicit val readableAsByteArray: BodyReadable[Array[Byte]]

    Permalink

    Converts a response body into Array[Byte].

    Converts a response body into Array[Byte].

    val byteArray = response.body[Array[Byte]]
    Definition Classes
    DefaultBodyReadables
  10. implicit val readableAsByteBuffer: BodyReadable[ByteBuffer]

    Permalink

    Converts a response body into a read only ByteBuffer.

    Converts a response body into a read only ByteBuffer.

    val buffer = response.body[ByteBuffer]
    Definition Classes
    DefaultBodyReadables
  11. implicit val readableAsByteString: BodyReadable[ByteString]

    Permalink

    Converts a response body into an akka.util.ByteString:

    Converts a response body into an akka.util.ByteString:

    val byteString = response.body[ByteString]
    Definition Classes
    DefaultBodyReadables
  12. implicit val readableAsSource: BodyReadable[Source[ByteString, _]]

    Permalink

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

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

    Definition Classes
    DefaultBodyReadables
  13. implicit val readableAsString: BodyReadable[String]

    Permalink

    Converts a response body into a String:

    Converts a response body into a String:

    val string = response.body[String]
    Definition Classes
    DefaultBodyReadables
  14. implicit val writableOf_File: BodyWritable[File]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  15. implicit val writableOf_InputStream: BodyWritable[Supplier[InputStream]]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  16. implicit val writableOf_Source: BodyWritable[Source[ByteString, _]]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  17. implicit val writeableOf_ByteArray: BodyWritable[Array[Byte]]

    Permalink

    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.

    Definition Classes
    DefaultBodyWritables
  18. implicit val writeableOf_ByteBuffer: BodyWritable[ByteBuffer]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  19. implicit val writeableOf_Bytes: BodyWritable[ByteString]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  20. implicit val writeableOf_String: BodyWritable[String]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  21. implicit val writeableOf_StringBuilder: BodyWritable[StringBuilder]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  22. implicit val writeableOf_WsBody: BodyWritable[WSBody]

    Permalink

    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.

    Definition Classes
    DefaultBodyWritables
  23. implicit val writeableOf_urlEncodedForm: BodyWritable[Map[String, Seq[String]]]

    Permalink

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

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

    Definition Classes
    DefaultBodyWritables
  24. implicit val writeableOf_urlEncodedSimpleForm: BodyWritable[Map[String, String]]

    Permalink
    Definition Classes
    DefaultBodyWritables

Inherited from DefaultBodyWritables

Inherited from DefaultBodyReadables

Inherited from AnyRef

Inherited from Any

Ungrouped