public class HttpClient extends Object implements Serializable
| Constructor and Description |
|---|
HttpClient() |
HttpClient(int maxConPerHost,
int conTimeOutMs,
int soTimeOutMs,
int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
Response |
delete(String url,
PostParameter[] params)
处理http deletemethod请求
|
static String |
encodeParameters(PostParameter[] postParams) |
Response |
get(String url)
处理http getmethod 请求
|
Response |
get(String url,
PostParameter[] params) |
Response |
get(String url,
PostParameter[] params,
Paging paging) |
String |
getProxyAuthPassword() |
String |
getProxyAuthUser() |
String |
getProxyHost() |
int |
getProxyPort() |
String |
getToken() |
Response |
httpRequest(org.apache.commons.httpclient.HttpMethod method) |
Response |
httpRequest(org.apache.commons.httpclient.HttpMethod method,
Boolean WithTokenHeader) |
Response |
multPartURL(String url,
PostParameter[] params,
ImageItem item)
支持multipart方式上传图片
|
Response |
multPartURL(String fileParamName,
String url,
PostParameter[] params,
File file,
boolean authenticated) |
Response |
post(String url,
PostParameter[] params)
处理http post请求
|
Response |
post(String url,
PostParameter[] params,
Boolean WithTokenHeader) |
void |
setProxyAuthPassword(String proxyAuthPassword)
Sets proxy authentication password.
|
void |
setProxyAuthUser(String proxyAuthUser)
Sets proxy authentication user.
|
void |
setProxyHost(String proxyHost)
Sets proxy host.
|
void |
setProxyPort(int proxyPort)
Sets proxy port.
|
String |
setToken(String token) |
public HttpClient()
public HttpClient(int maxConPerHost,
int conTimeOutMs,
int soTimeOutMs,
int maxSize)
public String getProxyHost()
public void setProxyHost(String proxyHost)
proxyHost - public int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort - public String getProxyAuthUser()
public void setProxyAuthUser(String proxyAuthUser)
proxyAuthUser - public String getProxyAuthPassword()
public void setProxyAuthPassword(String proxyAuthPassword)
proxyAuthPassword - public Response get(String url) throws WeiboException
WeiboExceptionpublic Response get(String url, PostParameter[] params) throws WeiboException
WeiboExceptionpublic Response get(String url, PostParameter[] params, Paging paging) throws WeiboException
WeiboExceptionpublic Response delete(String url, PostParameter[] params) throws WeiboException
WeiboExceptionpublic Response post(String url, PostParameter[] params) throws WeiboException
WeiboExceptionpublic Response post(String url, PostParameter[] params, Boolean WithTokenHeader) throws WeiboException
WeiboExceptionpublic Response multPartURL(String url, PostParameter[] params, ImageItem item) throws WeiboException
WeiboExceptionpublic Response multPartURL(String fileParamName, String url, PostParameter[] params, File file, boolean authenticated) throws WeiboException
WeiboExceptionpublic Response httpRequest(org.apache.commons.httpclient.HttpMethod method) throws WeiboException
WeiboExceptionpublic Response httpRequest(org.apache.commons.httpclient.HttpMethod method, Boolean WithTokenHeader) throws WeiboException
WeiboExceptionpublic static String encodeParameters(PostParameter[] postParams)
public String getToken()
Copyright © 2013. All Rights Reserved.