This is a type class pattern for writing different types of bodies to a WS request.
Default Writeable.
A WS proxy.
A file body
An in memory body
An in memory body
The bytes of the body
The WSClient holds the configuration information needed to build a request, and provides a way to get a request holder.
A WS Request builder.
A streamed body
A streamed body
A flow of the bytes of the body
A streamed response containing a response header and a streamable body.
A body for the request
A Play specific WS client that can use Play specific classes in the request and response building.
A Play specific WS client that can use Play specific classes in the request and response building.
Typically, access this class through dependency injection, i.e.
class MyService @Inject()(ws: WSClient) { val response: Future[WSResponse] = ws.url("http://example.com").get() }
Please see the documentation at https://www.playframework.com/documentation/latest/ScalaWS for more details.
WS client config
WS client config
The maximum time to wait when connecting to the remote host (default is 120 seconds).
The maximum time the request can stay idle (connection is established but waiting for more data) (default is 120 seconds).
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).
Configures the client to follow 301 and 302 redirects (default is true).
To use the JVM system’s HTTP proxy settings (http.proxyHost, http.proxyPort) (default is true).
To configure the User-Agent header field (default is None).
Set it to true to use gzip/deflater encoding (default is false).
use custom SSL / TLS configuration, see https://typesafehub.github.io/ssl-config/ for documentation.
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()
A WS Cookie.
A WS Cookie. This is a trait so that we are not tied to a specific client.
A WS proxy.
A WS Request builder.
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)))) } }
A WS Response that can use Play specific classes.
An HTTP response header (the body has not been retrieved yet)
Sign a WS call with OAuth.
An empty body
This is a type class pattern for writing different types of bodies to a WS request.