play.api.libs

ws

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
Learn more about member selection
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

    A WS proxy.

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

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

    A file body

  4. case class InMemoryBody(bytes: Array[Byte]) extends WSBody with Product with Serializable

    An in memory body

    An in memory body

    bytes

    The bytes of the body

  5. case class StreamedBody(bytes: Enumerator[Array[Byte]]) extends WSBody with Product with Serializable

    A streamed body

    A streamed body

    bytes

    An enumerator of the bytes of the body

  6. trait WSAPI extends AnyRef

    The base WS API trait.

    The base WS API trait. Plugins should extend this.

  7. trait WSAuthScheme extends AnyRef

  8. sealed trait WSBody extends AnyRef

    A body for the request

  9. trait WSClient extends AnyRef

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

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

    WS client config

  11. class WSConfigParser extends Provider[WSClientConfig]

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

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

    Annotations
    @Singleton()
  12. trait WSCookie extends AnyRef

    A WS Cookie.

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

  13. trait WSProxyServer extends AnyRef

    A WS proxy.

  14. trait WSRequest extends AnyRef

    A WS Request builder.

  15. trait WSRequestMagnet extends AnyRef

    WSRequestMagnet magnet.

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

    See also

    The magnet pattern

  16. trait WSResponse extends AnyRef

  17. trait WSResponseHeaders extends AnyRef

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

  18. trait WSSignatureCalculator extends AnyRef

    Sign a WS call with OAuth.

  19. type WSRequestHolder = WSRequest

    Annotations
    @deprecated
    Deprecated

    (Since version 2.4.0) Use WSRequest

Value Members

  1. object EmptyBody extends WSBody with Product with Serializable

    An empty body

  2. object WS

    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

  4. package ning

  5. package ssl

Inherited from AnyRef

Inherited from Any

Ungrouped