t

play.api.libs.ws

WSClient

trait WSClient extends Closeable

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("https://example.com").get()
}

Please see the documentation at https://www.playframework.com/documentation/latest/ScalaWS for more details.

Source
WSClient.scala
Linear Supertypes
Closeable, AutoCloseable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WSClient
  2. Closeable
  3. AutoCloseable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def close(): Unit

    Closes this client, and releases underlying resources.

    Closes this client, and releases underlying resources.

    Definition Classes
    WSClient → Closeable → AutoCloseable
    Annotations
    @throws(scala.this.throws.<init>$default$1[java.io.IOException])
  2. abstract def underlying[T]: T

    The underlying implementation of the client, if any.

    The underlying implementation of the client, if any. You must cast explicitly to the type you want.

    T

    the type you are expecting (i.e. isInstanceOf)

    returns

    the backing class.

  3. abstract def url(url: String): WSRequest

    Generates a request.

    Generates a request.

    url

    The base URL to make HTTP requests to.

    returns

    a request