HttpAgent¶
-
public interface
HttpAgent
¶ An OSGI Service for sending http requests.
Methods¶
execute¶
execute¶
execute¶
-
void
execute
(String url, Object data, Method method, Credentials credentials)¶ Executes the http request asynchronously.
Parameters: - url – the url for request
- data – the request data
- method – the http method
- credentials – the user credentials
execute¶
-
void
execute
(String url, Object data, Method method, Map<String, String> headers, Credentials credentials)¶ Executes the http request asynchronously.
Parameters: - url – the url for request
- data – the request data
- method – the http method
- headers – the request headers
- credentials – the user credentials
executeSync¶
executeSync¶
executeSync¶
-
void
executeSync
(String url, Object data, Method method, Credentials credentials)¶ Executes the http request synchronously.
Parameters: - url – the url for request
- data – the request data
- method – the http method
- credentials – the user credentials
executeSync¶
-
void
executeSync
(String url, Object data, Method method, Map<String, String> headers, Credentials credentials)¶ Executes the http request synchronously.
Parameters: - url – the url for request
- data – the request data
- method – the http method
- headers – the request headers
- credentials – the user credentials
executeWithReturnTypeSync¶
-
ResponseEntity<?>
executeWithReturnTypeSync
(String url, Object data, Method method)¶ Executes the http request synchronously and returns the response.
Parameters: - url – the url for request
- data – the request data
- method – the http method
Returns: response from posted request
executeWithReturnTypeSync¶
-
ResponseEntity<?>
executeWithReturnTypeSync
(String url, Object data, Method method, Integer retryCount)¶ Executes the http request synchronously and returns the response, takes additional parameter for number of retries.
Parameters: - url – the url for request
- data – the request data
- method – the http method
- retryCount – the number of retries
Returns: response from posted request
executeWithReturnTypeSync¶
-
ResponseEntity<?>
executeWithReturnTypeSync
(String url, Object data, Method method, Integer retryCount, Long retryInterval)¶ Executes the http request synchronously and returns the response, takes additional parameters for number of retries and interval between two retries.
Parameters: - url – the url for request
- data – the request data
- method – the http method
- retryCount – the number of retries
- retryInterval – the interval between two retries in milliseconds
Returns: response from posted request