@Deprecated public interface HttpVisitor
Modifier and Type | Method and Description |
---|---|
void |
addCookie(org.apache.commons.httpclient.Cookie cookie)
Deprecated.
添加Cookie
|
void |
addCookie(org.apache.commons.httpclient.Cookie[] cookies)
Deprecated.
添加一组Cookie
|
org.apache.commons.httpclient.Cookie[] |
getCookies()
Deprecated.
返回Cookie,在请求完成之后获取,得到是的从浏览器从传入的
|
org.apache.commons.httpclient.HttpClient |
getHttpClient()
Deprecated.
获取HttpClient对象
|
org.apache.commons.httpclient.HttpState |
getHttpState()
Deprecated.
获取Http状态
|
String |
getUrl(String url,
Map<String,?> parameter)
Deprecated.
用get方式访问URL
|
void |
init()
Deprecated.
初始化,在访问url之前,必须调用init方法
|
String |
postSoap(String url,
String xmlEntiry)
Deprecated.
Post SOAP内容
|
String |
postSoap(String url,
String soapAction,
String xmlEntiry)
Deprecated.
Post SOAP内容
|
String |
postUrl(String url,
Map<String,?> parameter)
Deprecated.
用post方式访问URL
|
String |
postXml(String url,
String xmlEntiry)
Deprecated.
Post Xml内容
|
void |
setAlternateAuth(String host,
int port,
String username,
String password,
List<String> schemaList)
Deprecated.
设置自动检测安全校验
|
void |
setBasicAuth(String host,
int port,
String username,
String password)
Deprecated.
设置基本安全校验,realm和schema全部适应全部
比设定了realm和schema的性能差一些 |
void |
setBasicAuth(String host,
int port,
String realm,
String schema,
String username,
String password)
Deprecated.
设置基本安全校验
|
HttpVisitor |
setHeader(String key,
String value)
Deprecated.
设置Header值
|
void |
setHeaderMap(Map<String,String> header)
Deprecated.
设置Header
|
void |
setProxy(String proxyHost,
int proxyPort,
String userName,
String passwrod)
Deprecated.
设置代理
|
void |
setRequestCharset(String requestCharset)
Deprecated.
需要在请求之前设置
设置请求编码,如果不设置,则默认是ISO-8859-1 注意:修改此参数要慎重,确认服务器的解码格式是修改的编码,否则会导致乱码出现 |
void |
setResponseCharset(String charset)
Deprecated.
设置响应编码,如果不设置,则默认是UTF-8
|
void |
setTimeout(int timeout)
Deprecated.
设置超时时间,必须在init之前调用
|
void init()
void setProxy(String proxyHost, int proxyPort, String userName, String passwrod)
proxyHost
- 代理服务器主机域名或IPproxyPort
- 代理端口userName
- 用户名passwrod
- 密码void setBasicAuth(String host, int port, String realm, String schema, String username, String password)
host
- 服务器主机域名或IPport
- 端口realm
- 领域,可以为空,表示任何realm,由被访问端提供schema
- 校验模式,可以为空,表示任何schema,可选值有:Basic,Digest,NTLM,当然也可以自行扩展username
- 用户名password
- 密码void setBasicAuth(String host, int port, String username, String password)
host
- 服务器主机域名或IPport
- 端口username
- 用户名password
- 密码void setAlternateAuth(String host, int port, String username, String password, List<String> schemaList)
host
- port
- username
- password
- schemaList
- 支持的Schame列表org.apache.commons.httpclient.HttpState getHttpState()
void setResponseCharset(String charset)
charset
- void setRequestCharset(String requestCharset)
requestCharset
- void setTimeout(int timeout)
timeout
- void addCookie(org.apache.commons.httpclient.Cookie cookie)
cookie
- void addCookie(org.apache.commons.httpclient.Cookie[] cookies)
cookies
- org.apache.commons.httpclient.Cookie[] getCookies()
String getUrl(String url, Map<String,?> parameter)
url
- 要访问的URLparameter
- 要访问的参数String postUrl(String url, Map<String,?> parameter)
url
- 要访问的URLparameter
- 要访问的参数org.apache.commons.httpclient.HttpClient getHttpClient()
String postSoap(String url, String soapAction, String xmlEntiry)
url
- soapAction
- xmlEntiry
- String postSoap(String url, String xmlEntiry)
url
- xmlEntiry
- String postXml(String url, String xmlEntiry)
url
- xmlEntiry
- HttpVisitor setHeader(String key, String value)
key
- value
- Copyright © 2006–2018 TinyGroup. All rights reserved.