StandaloneAhcWSClient

play.api.libs.ws.ahc.StandaloneAhcWSClient
See theStandaloneAhcWSClient companion class

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply(config: AhcWSClientConfig, httpCache: Option[AhcHttpCache])(implicit materializer: Materializer): StandaloneAhcWSClient

Convenient factory method that uses a play.api.libs.ws.WSClientConfig value for configuration instead of an org.asynchttpclient.AsyncHttpClientConfig.

Convenient factory method that uses a play.api.libs.ws.WSClientConfig value for configuration instead of an org.asynchttpclient.AsyncHttpClientConfig.

Typical usage:

import play.api.libs.ws.ahc.StandaloneAhcWSClient

def example(someUrl: String)(implicit m: org.apache.pekko.stream.Materializer) = {
 implicit def ec = m.executionContext

 val client = StandaloneAhcWSClient()
 val request = client.url(someUrl).get()

 request.foreach { response =>
   //doSomething(response)
   client.close()
 }
}

Value parameters

config

configuration settings

httpCache

if not null, will be used for HTTP response caching.

materializer

the pekko materializer.

Attributes

Concrete fields

val blockingTimeout: FiniteDuration
val elementLimit: Int