package ws
- Alphabetic
- Public
- Protected
Type Members
- class BodyReadable[+R] extends AnyRef
- Annotations
- @implicitNotFound()
- class BodyWritable[-A] extends AnyRef
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()
- trait DefaultBodyReadables extends AnyRef
Defines common BodyReadable for a response backed by
org.asynchttpclient.Response. - trait DefaultBodyWritables extends AnyRef
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.
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 => ??? } } }
- 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
- 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
A WS proxy.
- case class InMemoryBody(bytes: ByteString) extends WSBody with Product with Serializable
An in memory body
An in memory body
- bytes
The bytes of the body
- case class SourceBody(source: Source[ByteString, _]) extends WSBody with Product with Serializable
A body containing a source of bytes
A body containing a source of bytes
- source
A flow of the bytes of the body
- trait StandaloneWSClient extends Closeable
The WSClient holds the configuration information needed to build a request, and provides a way to get a request holder.
- trait StandaloneWSRequest extends AnyRef
A WS Request builder.
- trait StandaloneWSResponse extends AnyRef
A WS HTTP response.
- trait WSAuthScheme extends AnyRef
- sealed trait WSBody extends AnyRef
A body for the request.
- 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
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://lightbend.github.io/ssl-config/ for documentation.
- class WSConfigParser extends Provider[WSClientConfig]
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
import play.api.libs.ws.WSConfigParser import com.typesafe.config.ConfigFactory val wsClientConfig = new WSConfigParser( ConfigFactory.load(), this.getClass.getClassLoader).parse()
- Annotations
- @Singleton()
- trait WSCookie extends AnyRef
A WS Cookie.
- trait WSProxyServer extends AnyRef
A WS proxy.
- trait WSRequestExecutor extends (StandaloneWSRequest) => Future[StandaloneWSResponse]
- trait WSRequestFilter extends (WSRequestExecutor) => WSRequestExecutor
A request filter.
A request filter. Override this trait to implement your own filters:
import play.api.libs.ws.{ WSRequestFilter, WSRequestExecutor } class HeaderAppendingFilter(key: String, value: String) extends WSRequestFilter { override def apply(executor: WSRequestExecutor): WSRequestExecutor = { WSRequestExecutor(r => executor(r.withHttpHeaders((key, value)))) } }
- trait WSSignatureCalculator extends AnyRef
Sign a WS call with OAuth.
Value Members
- object BodyReadable
- object BodyWritable
- object DefaultBodyReadables extends DefaultBodyReadables
- object DefaultBodyWritables extends DefaultBodyWritables
- case object EmptyBody extends WSBody with Product with Serializable
- object WSAuthScheme
- object WSRequestExecutor
- object WSRequestFilter