WSClient

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.

Attributes

Graph
Supertypes
trait Closeable
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def close(): Unit

Closes this client, and releases underlying resources.

Closes this client, and releases underlying resources.

Attributes

def underlying[T]: T

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

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

Type parameters

T

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

Attributes

Returns

the backing class.

def url(url: String): WSRequest

Generates a request.

Generates a request.

Value parameters

url

The base URL to make HTTP requests to.

Attributes

Returns

a request