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()
StandaloneWSClient
getUnderlying
in interface StandaloneWSClient
public StandaloneAhcWSRequest url(java.lang.String url)
StandaloneWSClient
CompletionStage<StandaloneWSResponse>
.url
in interface StandaloneWSClient
url
- the URL to requestpublic void close() throws java.io.IOException
StandaloneWSClient
Use this for manually instantiated clients.
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface StandaloneWSClient
java.io.IOException
public 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