HttpClient Authentication Doument:
http://hc.apache.org/httpclient-3.x/authentication.html
HttpClient支持使用代理服务器以及身份认证
1、代理服务器的设置很简单:
HttpClient client = new HttpClient();
client.getHostConfiguration().setProxy(host, port);
2、身份验证:
HttpClient client = new HttpClient();
client.getParams().setAuthenticationPreemptive(true);
Credentials defaultcreds = new UsernamePasswordCredentials("username", "password");
client.getState().setCredentials(AuthScope.ANY, defaultcreds);
HttpClient支持使用代理服务器以及身份认证
精选 转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
使用虚拟用户身份验证和TLS加密的FTP文件服务器
基于TLS的FTP服务器搭建
ftp vsftpd TLS 虚拟用户