Results 1 to 1 of 1
  1. #1
    Jsharma is offline Member
    Join Date
    Jan 2011
    Rep Power

    Unhappy Proxy authentication using HttpClient 4.0.3

    Hi all
    I am using HttpClient 4.0.3 Api for proxy authentication,i am getting the following errors, can some one plz help me in this.

    at org.apache.http.impl.client.AbstractHttpClient.exe cute(
    at org.apache.http.impl.client.AbstractHttpClient.exe cute(
    at org.apache.http.impl.client.AbstractHttpClient.exe cute(
    at methodXYZ.<init>(
    at methodXYZ.main(
    Caused by: org.apache.http.auth.MalformedChallengeException: Authentication challenge is empty
    at org.apache.http.impl.auth.RFC2617Scheme.parseChall enge(
    at org.apache.http.impl.auth.AuthSchemeBase.processCh allenge(
    at org.apache.http.impl.auth.BasicScheme.processChall enge(
    at org.apache.http.impl.client.DefaultRequestDirector .processChallenges( 3)
    at org.apache.http.impl.client.DefaultRequestDirector .handleResponse(
    at org.apache.http.impl.client.DefaultRequestDirector .execute(
    at org.apache.http.impl.client.AbstractHttpClient.exe cute(
    ... 4 more

    below is the code which i am using

    public methodXYZ()
    HttpGet httpGet = null;
    HttpEntity entity = null;
    HttpResponse response = null;
    DefaultHttpClient httpclient = new DefaultHttpClient();

    HttpHost proxy = new HttpHost("", 8080);
    httpclient.getParams().setParameter(ConnRoutePName s.DEFAULT_PROXY, proxy);

    httpclient.getCredentialsProvider().setCredentials (new AuthScope("", 8080),new UsernamePasswordCredentials("username", "password"));
    httpGet = new HttpGet("");
    try {
    response =httpclient.execute(httpGet);
    entity = response.getEntity();
    catch (ClientProtocolException e) {
    } catch (IOException e) {

    Last edited by Jsharma; 01-21-2011 at 05:04 AM.

Similar Threads

  1. httpClient API to Download a xls file.
    By mpahlenig in forum New To Java
    Replies: 1
    Last Post: 01-13-2010, 04:31 AM
  2. Using HttpClient
    By jdetloff in forum New To Java
    Replies: 4
    Last Post: 01-06-2010, 11:43 AM
  3. Using HttpClient with Eclipse
    By jdetloff in forum Eclipse
    Replies: 4
    Last Post: 01-06-2010, 10:47 AM
  4. Http - proxy or non-proxy ?
    By Shiv in forum Networking
    Replies: 0
    Last Post: 04-11-2009, 08:07 AM
  5. Replies: 1
    Last Post: 08-05-2008, 10:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts