-
- All Known Implementing Classes:
DefaultHttpClient
public interface HttpClientA simple interface for executing HTTP requests.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Response<java.util.Map>delete(java.lang.String url)default Response<java.util.Map>delete(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders)<B> Response<B>delete(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)PerformDELETEoperation against an endpoint.default <B> Response<B>get(java.lang.String url, java.lang.Class<B> clazz)<B> Response<B>get(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)PerformGEToperation against an endpoint.default voidget(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.nio.file.Path dest)voidget(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.nio.file.Path dest, int retries)PerformGEToperation that downloads a file to the given path.default voidmodifyConnection(java.net.HttpURLConnection httpUrlConnection)Override this method if you could like to extendDefaultHttpClientand perform customer HTTP operations beforeURLConnection.connect()is called on the instance of the passed in connection.default <R,B>
Response<B>post(java.lang.String url, R request, java.lang.Class<B> clazz)<R,B>
Response<B>post(java.lang.String url, R request, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)PerformPOSToperation against an endpoint.default <R,B>
Response<B>put(java.lang.String url, R request, java.lang.Class<B> clazz)<R,B>
Response<B>put(java.lang.String url, R request, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)PerformPUToperation against an endpoint.
-
-
-
Method Detail
-
get
<B> Response<B> get(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)
PerformGEToperation against an endpoint.- Type Parameters:
B- The response body type.- Parameters:
url- The URL on which to perform the operation.parameters- An arbitrary number of parameters to add to the URL.additionalHeaders- Additional headers for the request.clazz- The class for the Response's body.- Returns:
- The results of the query.
- Throws:
HttpClientException- An error has occurred while executing the HTTP request.
-
get
default <B> Response<B> get(java.lang.String url, java.lang.Class<B> clazz)
-
get
void get(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.nio.file.Path dest, int retries) throws java.lang.InterruptedExceptionPerformGEToperation that downloads a file to the given path.- Parameters:
url- The URL on which to perform the operation.parameters- An arbitrary number of parameters to add to the URL.additionalHeaders- Additional headers for the request.dest- The destination to which the file will be downloaded.retries- The retry attempt index, if download fails.- Throws:
java.lang.InterruptedException- The thread was interrupted during retries.HttpClientException- An error has occurred while executing the HTTP request.
-
get
default void get(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.nio.file.Path dest) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
post
<R,B> Response<B> post(java.lang.String url, R request, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)
PerformPOSToperation against an endpoint.- Type Parameters:
R- The Request type.B- The Response body type.- Parameters:
url- The URL on which to perform the operation.request- The element to be serialized into the request body.parameters- An arbitrary number of parameters to add to the URL.additionalHeaders- Additional headers for the request.clazz- The class for the Response's body.- Returns:
- The results of the query.
- Throws:
HttpClientException- An error has occurred while executing the HTTP request.
-
post
default <R,B> Response<B> post(java.lang.String url, R request, java.lang.Class<B> clazz)
-
put
<R,B> Response<B> put(java.lang.String url, R request, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)
PerformPUToperation against an endpoint.- Type Parameters:
R- The Request type.B- The Response body type.- Parameters:
url- The URL on which to perform the operation.request- The element to be serialized into the request body.parameters- An arbitrary number of parameters to add to the URL.additionalHeaders- Additional headers for the request.clazz- The class for the Response's body.- Returns:
- The results of the query.
- Throws:
HttpClientException- An error has occurred while executing the HTTP request.
-
put
default <R,B> Response<B> put(java.lang.String url, R request, java.lang.Class<B> clazz)
-
delete
<B> Response<B> delete(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders, java.lang.Class<B> clazz)
PerformDELETEoperation against an endpoint.- Type Parameters:
B- The Response body type.- Parameters:
url- The URL on which to perform the operation.parameters- An arbitrary number of parameters to add to the URL.additionalHeaders- Additional headers for the request.clazz- The class for the Response's body.- Returns:
- The results of the query.
- Throws:
HttpClientException- An error has occurred while executing the HTTP request.
-
delete
default Response<java.util.Map> delete(java.lang.String url, java.util.List<Parameter> parameters, java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
-
delete
default Response<java.util.Map> delete(java.lang.String url)
-
modifyConnection
default void modifyConnection(java.net.HttpURLConnection httpUrlConnection)
Override this method if you could like to extendDefaultHttpClientand perform customer HTTP operations beforeURLConnection.connect()is called on the instance of the passed in connection.- Parameters:
httpUrlConnection- The URL connection to modify.
-
-