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 8343871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:11:58+00:00 2026-06-09T06:11:58+00:00

I am trying to connect to my company database but keep on getting authentication

  • 0

I am trying to connect to my company database but keep on getting authentication error. This is the code that tries to access the website where the api’s are. These api connect with the database.

DefaultHttpClient httpClient = new DefaultHttpClient();
        URL url1 = new URL ("http://www.xxxxxxx.com/");
        String encoding = new   String(org.apache.commons.codec.binary.Base64.encodeBase64
                (org.apache.commons.codec.binary.StringUtils.getBytesUtf8("xx:xxxxxx"))
                );
        HttpPost httpPost = new HttpPost(url);
        httpPost.setHeader("Authorization", "Basic" + encoding);           
        httpPost.setEntity(new UrlEncodedFormEntity(params)); 
        HttpResponse httpResponse = httpClient.execute(httpPost);
        HttpEntity httpEntity = httpResponse.getEntity();
        is = httpEntity.getContent();
  • 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-09T06:12:00+00:00Added an answer on June 9, 2026 at 6:12 am

    Could it be you are missing a space in your Authorization header?

    httpPost.setHeader("Authorization", "Basic " + encoding);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to a FTP using Apaches FTPSClient but I keep getting
I am trying to access the SQL database that exist in the company premises
So I am trying to connect to my company's website through an HTTP authentication
I am trying to connect the JSF to database. This are the files web.xml
I am trying to connect Hibernate(3.2.5) with PostgreSQL 8.2., but I am getting following
I'm trying to connect to my database that is located in a server with
While trying to connect to a database that's set to read only, the connection
I am trying to connect to a MySQL 5.5 database as follows: public void
When trying to connect to my database server, i encounter the problem of unknown
hi am trying to insert values into SQL database using jdbc. Current code able

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.