public class StandaloneAhcWSClient extends java.lang.Object implements StandaloneWSClient
| Constructor and Description |
|---|
StandaloneAhcWSClient(play.shaded.ahc.org.asynchttpclient.AsyncHttpClient asyncHttpClient,
akka.stream.Materializer materializer)
Creates a new client with the default Jackson ObjectMapper.
|
StandaloneAhcWSClient(play.shaded.ahc.org.asynchttpclient.AsyncHttpClient asyncHttpClient,
akka.stream.Materializer materializer,
com.fasterxml.jackson.databind.ObjectMapper mapper)
Creates a new client.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this client, and releases underlying resources.
|
static StandaloneAhcWSClient |
create(play.api.libs.ws.ahc.AhcWSClientConfig ahcWSClientConfig,
javax.cache.Cache<play.api.libs.ws.ahc.cache.EffectiveURIKey,play.api.libs.ws.ahc.cache.ResponseEntry> cache,
akka.stream.Materializer materializer)
A convenience method for creating a StandaloneAhcWSClient from configuration.
|
java.lang.Object |
getUnderlying()
The underlying implementation of the client, if any.
|
StandaloneAhcWSRequest |
url(java.lang.String url)
Returns a StandaloneWSRequest object representing the URL.
|
@Inject
public StandaloneAhcWSClient(play.shaded.ahc.org.asynchttpclient.AsyncHttpClient asyncHttpClient,
akka.stream.Materializer materializer,
com.fasterxml.jackson.databind.ObjectMapper mapper)
asyncHttpClient - the underlying AsyncHttpClientmaterializer - the Materializer to use for streamsmapper - the ObjectMapper to use for serializing JSON objectspublic StandaloneAhcWSClient(play.shaded.ahc.org.asynchttpclient.AsyncHttpClient asyncHttpClient,
akka.stream.Materializer materializer)
asyncHttpClient - the underlying AsyncHttpClientmaterializer - the Materializer to use for streamspublic java.lang.Object getUnderlying()
StandaloneWSClientgetUnderlying in interface StandaloneWSClientpublic StandaloneAhcWSRequest url(java.lang.String url)
StandaloneWSClientCompletionStage<StandaloneWSResponse>.url in interface StandaloneWSClienturl - the URL to requestpublic void close()
throws java.io.IOException
StandaloneWSClientUse this for manually instantiated clients.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface StandaloneWSClientjava.io.IOExceptionpublic static StandaloneAhcWSClient create(play.api.libs.ws.ahc.AhcWSClientConfig ahcWSClientConfig, javax.cache.Cache<play.api.libs.ws.ahc.cache.EffectiveURIKey,play.api.libs.ws.ahc.cache.ResponseEntry> cache, akka.stream.Materializer materializer)
ahcWSClientConfig - the configuration objectcache - if not null, will be used for HTTP response caching.materializer - an akka materializer