public class HttpUtilsAsync
extends java.lang.Object
#get(String, com.loopj.android.http.RequestParams, com.loopj.android.http.AsyncHttpResponseHandler)
#post(String, com.loopj.android.http.RequestParams, com.loopj.android.http.AsyncHttpResponseHandler)
#getUseCookie(android.content.Context, String, java.util.HashMap, com.loopj.android.http.AsyncHttpResponseHandler)
#getWithCookie(android.content.Context, String, com.loopj.android.http.RequestParams, com.loopj.android.http.AsyncHttpResponseHandler)
#postWithCookie(android.content.Context, String, com.loopj.android.http.RequestParams, com.loopj.android.http.AsyncHttpResponseHandler)
#postUseCookie(android.content.Context, String, java.util.HashMap, com.loopj.android.http.AsyncHttpResponseHandler)
构造器和说明 |
---|
HttpUtilsAsync() |
限定符和类型 | 方法和说明 |
---|---|
static void |
get(java.lang.String url,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP GET request, without any parameters.
|
static void |
get(java.lang.String url,
RequestParams params,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP GET request with
com.loopj.android.http.RequestParams |
protected static java.lang.String |
getAbsoluteUrl(java.lang.String relativeUrl)
To get the true url.
|
static int |
getTimeout() |
static java.lang.String |
getUrlFromHashMap(java.lang.String originUrl,
java.util.HashMap hashMap)
To get the url with params.
|
static void |
getUseCookie(android.content.Context context,
java.lang.String url,
java.util.HashMap hashMap,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP GET request with cookies which are defined in hashmap
|
static void |
getWithCookie(android.content.Context context,
java.lang.String url,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP GET request with cookie which generate by own context
|
static void |
getWithCookie(android.content.Context context,
java.lang.String url,
RequestParams params,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP GET request with cookie which generate by own context
|
static void |
post(java.lang.String url,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP POST request, without any parameters.
|
static void |
post(java.lang.String url,
RequestParams params,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP POST request with
com.loopj.android.http.RequestParams |
static void |
postUseCookie(android.content.Context context,
java.lang.String url,
java.util.HashMap hashMap,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP POST request with cookies which are defined in hashmap
|
static void |
postWithCookie(android.content.Context context,
java.lang.String url,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP POST request with cookie which generate by own context
|
static void |
postWithCookie(android.content.Context context,
java.lang.String url,
RequestParams params,
AsyncHttpResponseHandler responseHandler)
Perform a HTTP POST request with cookie which generate by own context
|
static void |
setTimeout(int timeout) |
static void |
uploadFile(java.lang.String url,
java.util.List<org.apache.http.NameValuePair> paramsList,
java.lang.String fileParams,
java.io.File file,
AsyncHttpResponseHandler responseHandler)
Upload file with
com.loopj.android.http.SyncHttpClient |
static void |
uploadFiles(java.lang.String url,
java.util.List<org.apache.http.NameValuePair> paramsList,
java.lang.String fileParams,
java.util.List<java.io.File> files,
AsyncHttpResponseHandler responseHandler)
Upload files with
com.loopj.android.http.SyncHttpClient |
public static int getTimeout()
public static void setTimeout(int timeout)
public static void get(java.lang.String url, RequestParams params, AsyncHttpResponseHandler responseHandler)
com.loopj.android.http.RequestParams
url
- params
- responseHandler
- public static void post(java.lang.String url, RequestParams params, AsyncHttpResponseHandler responseHandler)
com.loopj.android.http.RequestParams
url
- params
- responseHandler
- public static void get(java.lang.String url, AsyncHttpResponseHandler responseHandler)
url
- responseHandler
- public static void getWithCookie(android.content.Context context, java.lang.String url, AsyncHttpResponseHandler responseHandler)
context
- url
- responseHandler
- public static void getUseCookie(android.content.Context context, java.lang.String url, java.util.HashMap hashMap, AsyncHttpResponseHandler responseHandler)
context
- url
- hashMap
- responseHandler
- public static void getWithCookie(android.content.Context context, java.lang.String url, RequestParams params, AsyncHttpResponseHandler responseHandler)
context
- url
- responseHandler
- public static void post(java.lang.String url, AsyncHttpResponseHandler responseHandler)
url
- responseHandler
- public static void postWithCookie(android.content.Context context, java.lang.String url, AsyncHttpResponseHandler responseHandler)
context
- url
- responseHandler
- public static void postWithCookie(android.content.Context context, java.lang.String url, RequestParams params, AsyncHttpResponseHandler responseHandler)
context
- url
- params
- responseHandler
- public static void postUseCookie(android.content.Context context, java.lang.String url, java.util.HashMap hashMap, AsyncHttpResponseHandler responseHandler)
context
- url
- hashMap
- responseHandler
- protected static java.lang.String getAbsoluteUrl(java.lang.String relativeUrl)
relativeUrl
- public static java.lang.String getUrlFromHashMap(java.lang.String originUrl, java.util.HashMap hashMap)
originUrl
- hashMap
- public static void uploadFiles(java.lang.String url, java.util.List<org.apache.http.NameValuePair> paramsList, java.lang.String fileParams, java.util.List<java.io.File> files, AsyncHttpResponseHandler responseHandler) throws java.lang.Exception
com.loopj.android.http.SyncHttpClient
url
- paramsList
- fileParams
- files
- responseHandler
- java.lang.Exception
public static void uploadFile(java.lang.String url, java.util.List<org.apache.http.NameValuePair> paramsList, java.lang.String fileParams, java.io.File file, AsyncHttpResponseHandler responseHandler) throws java.io.FileNotFoundException
com.loopj.android.http.SyncHttpClient
url
- paramsList
- fileParams
- file
- responseHandler
- java.io.FileNotFoundException