org.tinygroup.httpvisit
接口 HttpVisitor

所有已知实现类:
HttpVisitorImpl

已过时。

@Deprecated
public interface HttpVisitor

HTTP访问接口,访问不同的网站,请构建不同的实例

作者:
luoguo

方法摘要
 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之前调用
 

方法详细信息

init

void init()
已过时。 
初始化,在访问url之前,必须调用init方法


setProxy

void setProxy(String proxyHost,
              int proxyPort,
              String userName,
              String passwrod)
已过时。 
设置代理

参数:
proxyHost - 代理服务器主机域名或IP
proxyPort - 代理端口
userName - 用户名
passwrod - 密码

setBasicAuth

void setBasicAuth(String host,
                  int port,
                  String realm,
                  String schema,
                  String username,
                  String password)
已过时。 
设置基本安全校验

参数:
host - 服务器主机域名或IP
port - 端口
realm - 领域,可以为空,表示任何realm,由被访问端提供
schema - 校验模式,可以为空,表示任何schema,可选值有:Basic,Digest,NTLM,当然也可以自行扩展
username - 用户名
password - 密码

setBasicAuth

void setBasicAuth(String host,
                  int port,
                  String username,
                  String password)
已过时。 
设置基本安全校验,realm和schema全部适应全部
比设定了realm和schema的性能差一些

参数:
host - 服务器主机域名或IP
port - 端口
username - 用户名
password - 密码

setAlternateAuth

void setAlternateAuth(String host,
                      int port,
                      String username,
                      String password,
                      List<String> schemaList)
已过时。 
设置自动检测安全校验

参数:
host -
port -
username -
password -
schemaList - 支持的Schame列表

getHttpState

org.apache.commons.httpclient.HttpState getHttpState()
已过时。 
获取Http状态

返回:
Http状态

setResponseCharset

void setResponseCharset(String charset)
已过时。 
设置响应编码,如果不设置,则默认是UTF-8

参数:
charset -

setRequestCharset

void setRequestCharset(String requestCharset)
已过时。 
需要在请求之前设置
设置请求编码,如果不设置,则默认是ISO-8859-1
注意:修改此参数要慎重,确认服务器的解码格式是修改的编码,否则会导致乱码出现

参数:
requestCharset -

setTimeout

void setTimeout(int timeout)
已过时。 
设置超时时间,必须在init之前调用

参数:
timeout -

addCookie

void addCookie(org.apache.commons.httpclient.Cookie cookie)
已过时。 
添加Cookie

参数:
cookie -

addCookie

void addCookie(org.apache.commons.httpclient.Cookie[] cookies)
已过时。 
添加一组Cookie

参数:
cookies -

getCookies

org.apache.commons.httpclient.Cookie[] getCookies()
已过时。 
返回Cookie,在请求完成之后获取,得到是的从浏览器从传入的

返回:
返回所有Cookie

getUrl

String getUrl(String url,
              Map<String,?> parameter)
已过时。 
用get方式访问URL

参数:
url - 要访问的URL
parameter - 要访问的参数
返回:
请求结果

postUrl

String postUrl(String url,
               Map<String,?> parameter)
已过时。 
用post方式访问URL

参数:
url - 要访问的URL
parameter - 要访问的参数
返回:
请求结果

getHttpClient

org.apache.commons.httpclient.HttpClient getHttpClient()
已过时。 
获取HttpClient对象

返回:
返回HttpClient对象

postSoap

String postSoap(String url,
                String soapAction,
                String xmlEntiry)
已过时。 
Post SOAP内容

参数:
url -
soapAction -
xmlEntiry -
返回:
请求结果

postSoap

String postSoap(String url,
                String xmlEntiry)
已过时。 
Post SOAP内容

参数:
url -
xmlEntiry -
返回:
请求结果

postXml

String postXml(String url,
               String xmlEntiry)
已过时。 
Post Xml内容

参数:
url -
xmlEntiry -
返回:
请求结果

setHeaderMap

void setHeaderMap(Map<String,String> header)
已过时。 
设置Header

参数:
header -

setHeader

HttpVisitor setHeader(String key,
                      String value)
已过时。 
设置Header值

参数:
key -
value -


Copyright © 2006–2016 TinyGroup. All rights reserved.