A WS proxy.
A file body
An in memory body
An in memory body
The bytes of the body
A streamed body
A streamed body
An enumerator of the bytes of the body
The base WS API trait.
The base WS API trait. Plugins should extend this.
A body for the request
The WSClient holds the configuration information needed to build a request, and provides a way to get a request holder.
WS client config
This class creates a DefaultWSClientConfig object from the play.api.Configuration.
This class creates a DefaultWSClientConfig object from the play.api.Configuration.
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.
WSRequestMagnet magnet.
WSRequestMagnet magnet. Please see the companion object for implicit definitions.
An HTTP response header (the body has not been retrieved yet)
Sign a WS call with OAuth.
(Since version 2.4.0) Use WSRequest
An empty body
Asynchronous API to to query web services, as an http client.
Asynchronous API to to query web services, as an http client.
Usage example:
WS.url("http://example.com/feed").get() WS.url("http://example.com/item").post("content")
When greater flexibility is needed, you can also create clients explicitly and pass them into WS:
implicit val client = new NingWSClient(builder.build()) WS.url("http://example.com/feed").get()
Or call the client directly:
import com.typesafe.config.ConfigFactory import play.api.libs.ws._ import play.api.libs.ws.ning._ val configuration = play.api.Configuration(ConfigFactory.parseString( """ |ws.ssl.trustManager = ... """.stripMargin)) val parser = new DefaultWSConfigParser(configuration, Play.current.classloader) val builder = new NingAsyncHttpClientConfigBuilder(parser.parse()) val secureClient: WSClient = new NingWSClient(builder.build()) val response = secureClient.url("https://secure.com").get()
Note that the resolution of URL is done through the magnet pattern defined in
WSRequestMagnet
.
The value returned is a Future[WSResponse]
, and you should use Play's asynchronous mechanisms to
use this response.
Asynchronous API to to query web services, as an http client.