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.
Defines common BodyReadable for a response backed by org.asynchttpclient.Response.
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 => ... } } }
A WS proxy.
An in memory body
An in memory body
The bytes of the body
A body containing a source of bytes
A body containing a source of bytes
A flow of 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 WS HTTP response.
A body for the request.
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 proxy.
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)))) } }
Sign a WS call with OAuth.
Converts a response body into Array[Byte].
Converts a response body into Array[Byte].
val byteArray = response.body[Array[Byte]]
Converts a response body into a read only ByteBuffer.
Converts a response body into a read only ByteBuffer.
val buffer = response.body[ByteBuffer]
Converts a response body into an akka.util.ByteString:
Converts a response body into an akka.util.ByteString:
val byteString = response.body[ByteString]
Converts a response body into Source[ByteString, NotUsed].
Converts a response body into Source[ByteString, NotUsed].
Converts a response body into a String:
Converts a response body into a String:
val string = response.body[String]
Creates an SourceBody with "application/octet-stream" content type from a file.
Creates an SourceBody with "application/octet-stream" content type from a file.
Creates an SourceBody with "application/octet-stream" content type from an inputstream.
Creates an SourceBody with "application/octet-stream" content type from an inputstream.
Creates an SourceBody with "application/octet-stream" content type from a file.
Creates an SourceBody with "application/octet-stream" content type from a file.
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.
Creates an InMemoryBody with "application/octet-stream" content type from a bytebuffer.
Creates an InMemoryBody with "application/octet-stream" content type from a bytebuffer.
Creates an InMemoryBody with "application/octet-stream" content type.
Creates an InMemoryBody with "application/octet-stream" content type.
Creates an InMemoryBody with "text/plain" content type.
Creates an InMemoryBody with "text/plain" content type.
Creates an InMemoryBody with "text/plain" content type from a StringBuilder
Creates an InMemoryBody with "text/plain" content type from a StringBuilder
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.
Creates an InMemoryBody with "application/x-www-form-urlencoded" content type.
Creates an InMemoryBody with "application/x-www-form-urlencoded" content type.
Provides type class BodyReadables and BodyWritables when you import the package object.