public class AsyncHttpClient extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
AsyncHttpClient.ClientExecutorTask |
| Modifier and Type | Field and Description |
|---|---|
static String |
userAgent
User agent to send with every request.
|
| Constructor and Description |
|---|
AsyncHttpClient(String baseUrl)
Creates a new client using a base Url without a timeout
|
AsyncHttpClient(String baseUrl,
long timeout)
Creates a new client using a base Url with a timeout in MS
|
AsyncHttpClient(Uri baseUri)
Creates a new client using a base Uri without a timeout
|
AsyncHttpClient(Uri baseUri,
long timeout)
Creates a new client using a base Uri with a timeout in MS
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels a request if it's running
|
void |
delete(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(String path,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(String path,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(String path,
List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(String path,
List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
delete(String path,
ResponseHandler response)
Performs a DELETE request on the baseUri
|
void |
get(List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a GET request on the baseUri
|
void |
get(List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a GET request on the baseUri
|
void |
get(ResponseHandler response)
Performs a GET request on the baseUri
|
void |
get(String path,
List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a GET request on the baseUri
|
void |
get(String path,
List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a GET request on the baseUri
|
void |
get(String path,
ResponseHandler response)
Performs a GET request on the baseUri
|
void |
head(List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a HEAD request on the baseUri
|
void |
head(List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a HEAD request on the baseUri
|
void |
head(ResponseHandler response)
Performs a HEAD request on the baseUri
|
void |
head(String path,
List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a HEAD request on the baseUri
|
void |
head(String path,
List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a HEAD request on the baseUri
|
void |
head(String path,
ResponseHandler response)
Performs a HEAD request on the baseUri
|
void |
options(List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a OPTIONS request on the baseUri
|
void |
options(List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a OPTIONS request on the baseUri
|
void |
options(ResponseHandler response)
Performs a OPTIONS request on the baseUri
|
void |
options(String path,
List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a OPTIONS request on the baseUri
|
void |
options(String path,
List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a OPTIONS request on the baseUri
|
void |
options(String path,
ResponseHandler response)
Performs a OPTIONS request on the baseUri
|
void |
patch(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(ResponseHandler response)
Performs a PATCH request on the baseUr
|
void |
patch(String path,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(String path,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(String path,
List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(String path,
List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a PATCH request on the baseUri
|
void |
patch(String path,
ResponseHandler response)
Performs a PATCH request on the baseUr
|
void |
post(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(String path,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(String path,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(String path,
List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(String path,
List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a POST request on the baseUri
|
void |
post(String path,
ResponseHandler response)
Performs a POST request on the baseUr
|
void |
put(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(ResponseHandler response)
Performs a PUT request on the baseUr
|
void |
put(String path,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(String path,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(String path,
List<org.apache.http.NameValuePair> params,
org.apache.http.HttpEntity postData,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(String path,
List<org.apache.http.NameValuePair> params,
List<org.apache.http.Header> headers,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(String path,
List<org.apache.http.NameValuePair> params,
ResponseHandler response)
Performs a PUT request on the baseUri
|
void |
put(String path,
ResponseHandler response)
Performs a PUT request on the baseUr
|
void |
setAllowAllSsl(boolean allow) |
void |
setAllowRedirect(boolean allow) |
public static String userAgent
RequestUtil.getDefaultUserAgent()public AsyncHttpClient(String baseUrl)
baseUrl - The base connection urlpublic AsyncHttpClient(Uri baseUri)
baseUri - The base connection uripublic AsyncHttpClient(String baseUrl, long timeout)
baseUrl - The base connection urltimeout - The timeout in MSpublic AsyncHttpClient(Uri baseUri, long timeout)
baseUri - The base connection uritimeout - The timeout in MSpublic void cancel()
public void get(ResponseHandler response)
response - The response handler for the requestpublic void get(String path, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void get(List<org.apache.http.Header> headers, ResponseHandler response)
headers - The request headers for the connectionresponse - The response handler for the requestpublic void get(List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
params - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void get(String path, List<org.apache.http.NameValuePair> params, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void get(String path, List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void options(ResponseHandler response)
response - The response handler for the requestpublic void options(String path, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void options(List<org.apache.http.Header> headers, ResponseHandler response)
headers - The request headers for the connectionresponse - The response handler for the requestpublic void options(List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
params - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void options(String path, List<org.apache.http.NameValuePair> params, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void options(String path, List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void head(ResponseHandler response)
response - The response handler for the requestpublic void head(String path, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void head(List<org.apache.http.Header> headers, ResponseHandler response)
headers - The request headers for the connectionresponse - The response handler for the requestpublic void head(List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
params - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void head(String path, List<org.apache.http.NameValuePair> params, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void head(String path, List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void delete(ResponseHandler response)
response - The response handler for the requestpublic void delete(String path, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void delete(List<org.apache.http.NameValuePair> params, ResponseHandler response)
params - The Query params to append to the baseUriresponse - The response handler for the requestpublic void delete(List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
params - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void delete(org.apache.http.HttpEntity postData,
ResponseHandler response)
postData - The post data entity to post to the serverresponse - The response handler for the requestpublic void delete(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
postData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void delete(List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
params - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void delete(String path, List<org.apache.http.NameValuePair> params, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriresponse - The response handler for the requestpublic void delete(String path, List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void delete(String path, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void delete(String path, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void delete(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void delete(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void post(ResponseHandler response)
response - The response handler for the requestpublic void post(String path, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void post(List<org.apache.http.NameValuePair> params, ResponseHandler response)
params - The Query params to append to the baseUriresponse - The response handler for the requestpublic void post(List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
params - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void post(org.apache.http.HttpEntity postData,
ResponseHandler response)
postData - The post data entity to post to the serverresponse - The response handler for the requestpublic void post(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
postData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void post(List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
params - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void post(String path, List<org.apache.http.NameValuePair> params, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriresponse - The response handler for the requestpublic void post(String path, List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void post(String path, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void post(String path, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void post(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void post(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void put(ResponseHandler response)
response - The response handler for the requestpublic void put(String path, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void put(List<org.apache.http.NameValuePair> params, ResponseHandler response)
params - The Query params to append to the baseUriresponse - The response handler for the requestpublic void put(List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
params - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void put(org.apache.http.HttpEntity postData,
ResponseHandler response)
postData - The post data entity to post to the serverresponse - The response handler for the requestpublic void put(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
postData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void put(List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
params - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void put(String path, List<org.apache.http.NameValuePair> params, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriresponse - The response handler for the requestpublic void put(String path, List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void put(String path, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void put(String path, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void put(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void put(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void patch(ResponseHandler response)
response - The response handler for the requestpublic void patch(String path, ResponseHandler response)
path - The path extended from the baseUriresponse - The response handler for the requestpublic void patch(List<org.apache.http.NameValuePair> params, ResponseHandler response)
params - The Query params to append to the baseUriresponse - The response handler for the requestpublic void patch(List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
params - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void patch(org.apache.http.HttpEntity postData,
ResponseHandler response)
postData - The post data entity to post to the serverresponse - The response handler for the requestpublic void patch(org.apache.http.HttpEntity postData,
List<org.apache.http.Header> headers,
ResponseHandler response)
postData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void patch(List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
params - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void patch(String path, List<org.apache.http.NameValuePair> params, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriresponse - The response handler for the requestpublic void patch(String path, List<org.apache.http.NameValuePair> params, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUriheaders - The request headers for the connectionresponse - The response handler for the requestpublic void patch(String path, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void patch(String path, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void patch(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverresponse - The response handler for the requestpublic void patch(String path, List<org.apache.http.NameValuePair> params, org.apache.http.HttpEntity postData, List<org.apache.http.Header> headers, ResponseHandler response)
path - The path extended from the baseUriparams - The Query params to append to the baseUripostData - The post data entity to post to the serverheaders - The request headers for the connectionresponse - The response handler for the requestpublic void setAllowAllSsl(boolean allow)
public void setAllowRedirect(boolean allow)