Constructor and Description |
---|
AhcWSClient(StandaloneAhcWSClient client) |
Modifier and Type | Method and Description |
---|---|
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.
|
@Inject public AhcWSClient(StandaloneAhcWSClient client)
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 WSRequest url(java.lang.String url)
WSClient
Promise<WSResponse>
.public void close() throws java.io.IOException
WSClient
Use this for manually instantiated clients.