Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7937697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:35:08+00:00 2026-06-03T22:35:08+00:00

final HttpClient hClient = new DefaultHttpClient(); final HttpPost hPost = new HttpPost( http://xxx.xxx); try

  • 0
final HttpClient hClient = new DefaultHttpClient();
final HttpPost hPost = new HttpPost(
        "http://xxx.xxx");
try {
    hPost.setHeader("Accept", "application/json");
    hPost.setHeader("Content-type",
            "application/json");
    hPost.setEntity(new StringEntity(JSON));
    // execute request
    final HttpResponse response = hClient
            .execute(hPost);
    final HttpEntity entity = response.getEntity();

Android returns 05-16 20:02:52.784: W/DefaultRequestDirector(15642): Authentication error: Unable to respond to any of these challenges: {} and I don’t know how to fix it. Where is the problem and how can I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:35:09+00:00Added an answer on June 3, 2026 at 10:35 pm

    Try setting the Http parameters as following:

    HttpParams myParams = new BasicHttpParams();
    
    HttpConnectionParams.setSoTimeout(myParams, 10000);
    HttpConnectionParams.setConnectionTimeout(myParams, 10000); // Timeout
    
    DefaultHttpClient httpClient = new DefaultHttpClient(myParams);
    

    For the http post and response you can try the following code. Kindly customize according to your needs (for example set your string parameters)

    HttpResponse response;
    httpClient.getParams().setParameter("Your String", "YourStringValue");
    localContext = new BasicHttpContext();
    HttpPost httpPost = new HttpPost(YOurURL);
    
    Log.e("URL", URL); //just to check 
    
    httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY,CookiePolicy.RFC_2109);
    
    StringEntity tmp = null;
    
    httpPost.setHeader("Accept", "application/json");
    
    tmp = new StringEntity(inputJObject.toString(), "UTF-8");
    
    httpPost.setEntity(tmp);
    
    response = httpClient.execute(httpPost, localContext);
    
    
    Log.i(TAG, response.getStatusLine().toString()); // Examine the response status
    
    
    HttpEntity entity = response.getEntity();  // Get hold of the response entity
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

final String message[] = {,,}; try{ String UID = null, UBAL = null; DateFormat
I'm trying to add a referer to an http post in Apache HttpClient (httpclient-4.0-beta2).
I am currently getting to grips with new HttpClient libraries to come up with
I would like to convert the DefaultHttpClient to a singleton class public class HttpClient
This is the example for Custom SSL Context from HttpClient-4.x documentation: http://hc.apache.org/httpcomponents-client-ga/examples.html Note: removing
I found a URL that httpclient doesn't seem to be handling redirects on: http://news.google.com/news/url?sa=t&fd=R&usg=AFQjCNGrJk-F7Dmshmtze2yhifxRsv8sRg&url=http://www.mtv.com/news/articles/1647243/20100907/story.jhtml
I'm developing an application in Android. The application can post a HTTP request to
Can final keyword be used for a method?
The final images produced by compliers contain both bin file and extended loader format
My final goal is to write the program which can run on the Unix

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.