public class AsyncHttpClient extends java.lang.Object implements HttpClient
| Modifier and Type | Field and Description |
|---|---|
protected org.asynchttpclient.AsyncHttpClient |
httpClient |
| Constructor and Description |
|---|
AsyncHttpClient()
Create an HttpClient based on the org.asynchttpclient library.
|
AsyncHttpClient(org.asynchttpclient.AsyncHttpClient client)
Create an HttpClient based on the org.asynchttpclient library.
|
AsyncHttpClient(org.asynchttpclient.AsyncHttpClientConfig config)
Create an HttpClient based on the org.asynchttpclient library.
|
AsyncHttpClient(java.util.concurrent.TimeUnit timeUnit,
int timeout)
Create an HttpClient based on the org.asynchttpclient library.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<java.lang.String> |
get(java.lang.String url)
Performs a GET request with the given url using the client from
org.asynchttpclient.
|
protected static java.util.concurrent.CompletableFuture<java.lang.String> |
getStringCompletableFuture(java.lang.String url,
org.asynchttpclient.AsyncHttpClient httpClient) |
public AsyncHttpClient()
Note: Default timeout is 1 second
public AsyncHttpClient(java.util.concurrent.TimeUnit timeUnit,
int timeout)
timeUnit - The time unit of the timeout.timeout - The timeout to use.public AsyncHttpClient(org.asynchttpclient.AsyncHttpClientConfig config)
config - An instance of an AsyncHttpClientConfig configuration for use by Ascendpublic AsyncHttpClient(org.asynchttpclient.AsyncHttpClient client)
client - An instance of an AsyncHttpClient for use by Ascendpublic java.util.concurrent.CompletableFuture<java.lang.String> get(java.lang.String url)
get in interface HttpClienturl - a valid url representing a call to the Participant API.protected static java.util.concurrent.CompletableFuture<java.lang.String> getStringCompletableFuture(java.lang.String url,
org.asynchttpclient.AsyncHttpClient httpClient)