public interface HttpClient
Modifier and Type | Method and 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)
Perform
DELETE operation 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)
Perform
GET operation against an endpoint. |
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)
|
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)
Perform
GET operation that downloads a file to the given path. |
default void |
modifyConnection(java.net.HttpURLConnection httpUrlConnection)
Override this method if you could like to extend
DefaultHttpClient and perform customer HTTP operations
before URLConnection.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)
Perform
POST operation 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)
Perform
PUT operation against an endpoint. |
<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)
GET
operation against an endpoint.B
- The response body type.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.HttpClientException
- An error has occurred while executing the HTTP request.default <B> Response<B> get(java.lang.String url, java.lang.Class<B> clazz)
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.InterruptedException
GET
operation that downloads a file to the given path.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.java.lang.InterruptedException
- The thread was interrupted during retries.HttpClientException
- An error has occurred while executing the HTTP request.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
java.lang.InterruptedException
<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)
POST
operation against an endpoint.R
- The Request type.B
- The Response body type.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.HttpClientException
- An error has occurred while executing the HTTP request.default <R,B> Response<B> post(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)
PUT
operation against an endpoint.R
- The Request type.B
- The Response body type.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.HttpClientException
- An error has occurred while executing the HTTP request.default <R,B> Response<B> put(java.lang.String url, R request, java.lang.Class<B> clazz)
<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)
DELETE
operation against an endpoint.B
- The Response body type.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.HttpClientException
- An error has occurred while executing the HTTP request.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)
default Response<java.util.Map> delete(java.lang.String url)
default void modifyConnection(java.net.HttpURLConnection httpUrlConnection)
DefaultHttpClient
and perform customer HTTP operations
before URLConnection.connect()
is called on the instance of the passed in connection.httpUrlConnection
- The URL connection to modify.