Package

play.api.libs

ws

Permalink

package ws

Asynchronous API to to query web services, as an http client.

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ws
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. 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.

  2. case class DefaultWSResponseHeaders(status: Int, headers: Map[String, Seq[String]]) extends WSResponseHeaders with Product with Serializable

    Permalink
  3. case class FileBody(file: File) extends WSBody with Product with Serializable

    Permalink

    A file body

  4. 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

  5. case class StreamedBody(bytes: Source[ByteString, _]) extends WSBody with Product with Serializable

    Permalink

    A streamed body

    A streamed body

    bytes

    A flow of the bytes of the body

  6. case class StreamedResponse(headers: WSResponseHeaders, body: Source[ByteString, _]) extends Product with Serializable

    Permalink

    A streamed response containing a response header and a streamable body.

  7. trait WSAPI extends AnyRef

    Permalink

    The base WS API trait.

    The base WS API trait. Plugins should extend this.

  8. trait WSAuthScheme extends AnyRef

    Permalink

  9. sealed trait WSBody extends AnyRef

    Permalink

    A body for the request

  10. trait WSClient extends Closeable

    Permalink

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

  11. 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: SSLConfig = SSLConfig()) extends Product with Serializable

    Permalink

    WS client config

  12. class WSConfigParser extends Provider[WSClientConfig]

    Permalink

    This class creates a DefaultWSClientConfig object from the play.api.Configuration.

    This class creates a DefaultWSClientConfig object from the play.api.Configuration.

    Annotations
    @Singleton()
  13. trait WSCookie extends AnyRef

    Permalink

    A WS Cookie.

    A WS Cookie. This is a trait so that we are not tied to a specific client.

  14. trait WSProxyServer extends AnyRef

    Permalink

    A WS proxy.

  15. trait WSRequest extends AnyRef

    Permalink

    A WS Request builder.

  16. trait WSRequestMagnet extends AnyRef

    Permalink

    WSRequestMagnet magnet.

    WSRequestMagnet magnet. Please see the companion object for implicit definitions.

    See also

    The magnet pattern

  17. trait WSResponse extends AnyRef

    Permalink

  18. trait WSResponseHeaders extends AnyRef

    Permalink

    An HTTP response header (the body has not been retrieved yet)

  19. trait WSSignatureCalculator extends AnyRef

    Permalink

    Sign a WS call with OAuth.

  20. type WSRequestHolder = WSRequest

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.4.0) Use WSRequest

Value Members

  1. object EmptyBody extends WSBody with Product with Serializable

    Permalink

    An empty body

  2. object WS

    Permalink

    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.

  3. object WSAuthScheme

    Permalink
  4. package ning

    Permalink
  5. package ssl

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped