February 11th, 2014, 05:06 AM
[Ask]How to use proxy in HttpClient? The proxy needs username and password!
I'd like to use httpclient to access the Internet, but it's necessary to use proxy....
But the proxy needs username and password! So how can I?...
HttpClient httpClient=new DefaultHttpClient();
AuthScope authScope=new AuthScope("proxy.urlnet.cn", 8080);
CredentialsProvider credentialsProvider=new BasicCredentialsProvider();
UsernamePasswordCredentials usernamePasswordCredentials=new UsernamePasswordCredentials("username", "password");
This way is invalid.....
Please help me!
Last edited by ckcz123; February 11th, 2014 at 05:07 AM.
Reason: Edit format of the code