Interface AsyncHttpClient
- All Known Implementing Classes:
HttpAsyncClientImpl
public interface AsyncHttpClient
Simple abstraction over async http operations needed by the salt client.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> CompletionStage<T> get(URI uri, JsonParser<T> parser) Send a GET request and parse the result into object of given type.<T> CompletionStage<T> Send a GET request and parse the result into object of given type.default <T> CompletionStage<T> post(URI uri, String data, JsonParser<T> parser) Send a POST request and parse the result into object of given type.<T> CompletionStage<T> Send a POST request and parse the result into object of given type.
-
Method Details
-
get
Send a GET request and parse the result into object of given type.- Type Parameters:
T- return type the response json will be parsed into- Parameters:
uri- uri to make the http request toheaders- headers to pass to the requestparser- parser to use for the response json- Returns:
- CompletionStage holding object of the given return type T
-
get
Send a GET request and parse the result into object of given type.- Type Parameters:
T- return type the response json will be parsed into- Parameters:
uri- uri to make the http request toparser- parser to use for the response json- Returns:
- CompletionStage holding object of the given return type T
-
post
Send a POST request and parse the result into object of given type.- Type Parameters:
T- return type the response json will be parsed into- Parameters:
uri- uri to make the http request toheaders- headers to pass to the requestdata- the data to send (in JSON format)parser- parser to use for the response json- Returns:
- CompletionStage holding object of the given return type T
-
post
Send a POST request and parse the result into object of given type.- Type Parameters:
T- return type the response json will be parsed into- Parameters:
uri- uri to make the http request todata- the data to send (in JSON format)parser- parser to use for the response json- Returns:
- CompletionStage holding object of the given return type T
-