AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | 静态 Public 成员函数 | Private 成员函数 | Private 属性 | 静态 Private 属性 | 所有成员列表
com.ab.http.AbHttpUtil类 参考

Public 成员函数

void get (String url, AbHttpResponseListener responseListener)
 
void get (String url, AbRequestParams params, AbHttpResponseListener responseListener)
 
void get (String url, AbBinaryHttpResponseListener responseListener)
 
void get (String url, AbRequestParams params, AbFileHttpResponseListener responseListener)
 
void post (String url, AbHttpResponseListener responseListener)
 
void post (String url, AbRequestParams params, AbHttpResponseListener responseListener)
 
void post (String url, AbRequestParams params, AbFileHttpResponseListener responseListener)
 
void setTimeout (int timeout)
 
void setEasySSLEnabled (boolean enabled)
 
void setEncode (String encode)
 
void setUserAgent (String userAgent)
 
void shutdownHttpClient ()
 

静态 Public 成员函数

static AbHttpUtil getInstance (Context context)
 

Private 成员函数

 AbHttpUtil (Context context)
 

Private 属性

AbHttpClient mClient = null
 

静态 Private 属性

static AbHttpUtil mAbHttpUtil = null
 

详细描述

© 2012 amsoft.cn 名称:AbHttpUtil.java 描述:Http执行工具类,可处理get,post,以及异步处理文件的上传下载

作者
还如一梦中
版本
v1.0
日期
:2013-10-22 下午4:15:52

构造及析构函数说明

com.ab.http.AbHttpUtil.AbHttpUtil ( Context  context)
inlineprivate

初始化AbHttpUtil.

参数
contextthe context

成员函数说明

void com.ab.http.AbHttpUtil.get ( String  url,
AbHttpResponseListener  responseListener 
)
inline

描述:无参数的get请求.

参数
urlthe url
responseListenerthe response listener
void com.ab.http.AbHttpUtil.get ( String  url,
AbRequestParams  params,
AbHttpResponseListener  responseListener 
)
inline

描述:带参数的get请求.

参数
urlthe url
paramsthe params
responseListenerthe response listener
void com.ab.http.AbHttpUtil.get ( String  url,
AbBinaryHttpResponseListener  responseListener 
)
inline

描述:下载数据使用,会返回byte数据(下载文件或图片).

参数
urlthe url
responseListenerthe response listener
void com.ab.http.AbHttpUtil.get ( String  url,
AbRequestParams  params,
AbFileHttpResponseListener  responseListener 
)
inline

描述:文件下载的get.

参数
urlthe url
paramsthe params
responseListenerthe response listener
static AbHttpUtil com.ab.http.AbHttpUtil.getInstance ( Context  context)
inlinestatic

描述:获取实例.

参数
contextthe context
返回
single instance of AbHttpUtil
void com.ab.http.AbHttpUtil.post ( String  url,
AbHttpResponseListener  responseListener 
)
inline

描述:无参数的post请求.

参数
urlthe url
responseListenerthe response listener
void com.ab.http.AbHttpUtil.post ( String  url,
AbRequestParams  params,
AbHttpResponseListener  responseListener 
)
inline

描述:带参数的post请求.

参数
urlthe url
paramsthe params
responseListenerthe response listener
void com.ab.http.AbHttpUtil.post ( String  url,
AbRequestParams  params,
AbFileHttpResponseListener  responseListener 
)
inline

描述:文件下载的post.

参数
urlthe url
paramsthe params
responseListenerthe response listener
void com.ab.http.AbHttpUtil.setEasySSLEnabled ( boolean  enabled)
inline

打开ssl 自签名(第一次请求前设置).

参数
enabled
void com.ab.http.AbHttpUtil.setEncode ( String  encode)
inline

设置编码(第一次请求前设置).

参数
encode
void com.ab.http.AbHttpUtil.setTimeout ( int  timeout)
inline

描述:设置连接超时时间(第一次请求前设置).

参数
timeout毫秒
void com.ab.http.AbHttpUtil.setUserAgent ( String  userAgent)
inline

设置用户代理(第一次请求前设置).

参数
userAgent
void com.ab.http.AbHttpUtil.shutdownHttpClient ( )
inline

关闭HttpClient 当HttpClient实例不再需要是,确保关闭connection manager,以释放其系统资源

类成员变量说明

AbHttpUtil com.ab.http.AbHttpUtil.mAbHttpUtil = null
staticprivate

工具类单例.

AbHttpClient com.ab.http.AbHttpUtil.mClient = null
private

实例化单例对象.


该类的文档由以下文件生成: