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); 

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2022-02-05
  • 2021-08-02
  • 2021-10-23
  • 2021-12-29
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案