Constructor and Description |
---|
AhcWSClient(play.shaded.ahc.org.asynchttpclient.AsyncHttpClient client,
akka.stream.Materializer materializer) |
AhcWSClient(StandaloneAhcWSClient client,
akka.stream.Materializer materializer) |
Modifier and Type | Method and Description |
---|---|
play.api.libs.ws.WSClient |
asScala() |
void |
close()
Closes this client, and releases underlying resources.
|
static AhcWSClient |
create(play.api.libs.ws.ahc.AhcWSClientConfig config,
javax.cache.Cache<play.api.libs.ws.ahc.cache.EffectiveURIKey,play.api.libs.ws.ahc.cache.ResponseEntry> cache,
akka.stream.Materializer materializer)
Creates WS client manually from configuration, internally creating a new
instance of AsyncHttpClient and managing its own thread pool.
|
java.lang.Object |
getUnderlying()
The underlying implementation of the client, if any.
|
WSRequest |
url(java.lang.String url)
Returns a WSRequest object representing the URL.
|
public AhcWSClient(play.shaded.ahc.org.asynchttpclient.AsyncHttpClient client, akka.stream.Materializer materializer)
@Inject public AhcWSClient(StandaloneAhcWSClient client, akka.stream.Materializer materializer)
public static AhcWSClient create(play.api.libs.ws.ahc.AhcWSClientConfig config, javax.cache.Cache<play.api.libs.ws.ahc.cache.EffectiveURIKey,play.api.libs.ws.ahc.cache.ResponseEntry> cache, akka.stream.Materializer materializer)
This client is not managed as part of Play's lifecycle, and must be closed by calling ws.close(), otherwise you will run into memory leaks.
config
- a config object, usually from AhcWSClientConfigFactorycache
- if not null, provides HTTP caching.materializer
- an Akka materializerpublic java.lang.Object getUnderlying()
WSClient
getUnderlying
in interface WSClient
public play.api.libs.ws.WSClient asScala()
public WSRequest url(java.lang.String url)
WSClient
Promise<WSResponse>
.public void close() throws java.io.IOException
WSClient
Use this for manually instantiated clients.