|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
@Deprecated public interface HttpVisitor
HTTP访问接口,访问不同的网站,请构建不同的实例
| 方法摘要 | |
|---|---|
void |
addCookie(org.apache.commons.httpclient.Cookie cookie)
已过时。 添加Cookie |
void |
addCookie(org.apache.commons.httpclient.Cookie[] cookies)
已过时。 添加一组Cookie |
org.apache.commons.httpclient.Cookie[] |
getCookies()
已过时。 返回Cookie,在请求完成之后获取,得到是的从浏览器从传入的 |
org.apache.commons.httpclient.HttpClient |
getHttpClient()
已过时。 获取HttpClient对象 |
org.apache.commons.httpclient.HttpState |
getHttpState()
已过时。 获取Http状态 |
String |
getUrl(String url,
Map<String,?> parameter)
已过时。 用get方式访问URL |
void |
init()
已过时。 初始化,在访问url之前,必须调用init方法 |
String |
postSoap(String url,
String xmlEntiry)
已过时。 Post SOAP内容 |
String |
postSoap(String url,
String soapAction,
String xmlEntiry)
已过时。 Post SOAP内容 |
String |
postUrl(String url,
Map<String,?> parameter)
已过时。 用post方式访问URL |
String |
postXml(String url,
String xmlEntiry)
已过时。 Post Xml内容 |
void |
setAlternateAuth(String host,
int port,
String username,
String password,
List<String> schemaList)
已过时。 设置自动检测安全校验 |
void |
setBasicAuth(String host,
int port,
String username,
String password)
已过时。 设置基本安全校验,realm和schema全部适应全部 比设定了realm和schema的性能差一些 |
void |
setBasicAuth(String host,
int port,
String realm,
String schema,
String username,
String password)
已过时。 设置基本安全校验 |
HttpVisitor |
setHeader(String key,
String value)
已过时。 设置Header值 |
void |
setHeaderMap(Map<String,String> header)
已过时。 设置Header |
void |
setProxy(String proxyHost,
int proxyPort,
String userName,
String passwrod)
已过时。 设置代理 |
void |
setRequestCharset(String requestCharset)
已过时。 需要在请求之前设置 设置请求编码,如果不设置,则默认是ISO-8859-1 注意:修改此参数要慎重,确认服务器的解码格式是修改的编码,否则会导致乱码出现 |
void |
setResponseCharset(String charset)
已过时。 设置响应编码,如果不设置,则默认是UTF-8 |
void |
setTimeout(int timeout)
已过时。 设置超时时间,必须在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 -
void setHeaderMap(Map<String,String> header)
header -
HttpVisitor setHeader(String key,
String value)
key - value -
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||