private static HttpClient getHttpClient() {
HttpClient httpClient = new HttpClient();
//设置代理服务器的ip地址和端口
httpClient.getHostConfiguration().setProxy("192.168.1.28", 808);
//使用抢先认证
httpClient.getParams().setAuthenticationPreemptive(true);
return httpClient;
}
转载于:https://my.oschina.net/syso4yy/blog/613122