public class RequestHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE_FORMAT |
static java.lang.String |
DATE_FORMAT_ISO_8601 |
static java.lang.String |
LIBRARY_VERSION |
static java.util.TimeZone |
UTC |
Modifier and Type | Method and Description |
---|---|
org.apache.http.HttpResponse |
executeCommand(org.apache.http.client.methods.HttpUriRequest request,
boolean apiHeaders)
Executes the request et the Uploadcare API and return the HTTP Response object.
|
<T,U> java.lang.Iterable<T> |
executePaginatedQuery(java.net.URI url,
java.util.List<UrlParameter> urlParameters,
boolean apiHeaders,
java.lang.Class<? extends PageData<U>> dataClass,
DataWrapper<T,U> dataWrapper) |
<T> T |
executeQuery(org.apache.http.client.methods.HttpUriRequest request,
boolean apiHeaders,
java.lang.Class<T> dataClass) |
static java.lang.String |
iso8601(java.util.Date date) |
java.lang.String |
makeSignature(org.apache.http.client.methods.HttpUriRequest request,
java.lang.String date) |
static java.lang.String |
rfc2822(java.util.Date date) |
void |
setApiHeaders(org.apache.http.client.methods.HttpUriRequest request) |
static void |
setQueryParameters(org.apache.http.client.utils.URIBuilder builder,
java.util.List<UrlParameter> parameters) |
public static final java.lang.String LIBRARY_VERSION
public static final java.lang.String DATE_FORMAT
public static final java.lang.String DATE_FORMAT_ISO_8601
public static final java.util.TimeZone UTC
public static java.lang.String rfc2822(java.util.Date date)
public static java.lang.String iso8601(java.util.Date date)
public java.lang.String makeSignature(org.apache.http.client.methods.HttpUriRequest request, java.lang.String date) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
public void setApiHeaders(org.apache.http.client.methods.HttpUriRequest request)
public <T> T executeQuery(org.apache.http.client.methods.HttpUriRequest request, boolean apiHeaders, java.lang.Class<T> dataClass)
public static void setQueryParameters(org.apache.http.client.utils.URIBuilder builder, java.util.List<UrlParameter> parameters)
public <T,U> java.lang.Iterable<T> executePaginatedQuery(java.net.URI url, java.util.List<UrlParameter> urlParameters, boolean apiHeaders, java.lang.Class<? extends PageData<U>> dataClass, DataWrapper<T,U> dataWrapper)
public org.apache.http.HttpResponse executeCommand(org.apache.http.client.methods.HttpUriRequest request, boolean apiHeaders)
Client
.request
- request to be sent to the APIapiHeaders
- TRUE if the default API headers should be set