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

  • Home
  • SEARCH
  • 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 7022881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:38:22+00:00 2026-05-27T23:38:22+00:00

Hi I saw an example on StackOverflow which had this code: String encoding =

  • 0

Hi I saw an example on StackOverflow which had this code:

String encoding = Base64Encoder.encode ("test1:test1");
HttpPost httppost = new HttpPost("http://host:post/test/login");
httppost.setHeader("Authorization", "Basic " + encoding);

System.out.println("executing request " + httppost.getRequestLine());
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();

I have a task similar to this. I tried to use the same code but I couldn’t find the Base64Encoder class anywhere. Im using httpclient-4.1.2.jar and httpcore-4.1.2.jar. Can someone help me with this?

  • 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-05-27T23:38:23+00:00Added an answer on May 27, 2026 at 11:38 pm

    I think you need to have commons codec also to use Base64 encoding with HttpClient. Here is link. Commons codec link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
I saw this example in php manual page http://www.php.net/manual/en/session.examples.php The example will create a
I saw this example about storing login information in cookie. http://eisabainyo.net/weblog/2009/02/20/store-login-information-in-cookie-using-jquery/ Tried it, but
i saw a example for login form same blow code class Form_Login extends Zend_Form
Saw this piece of code in a Ruby on Rails book. This first one
I saw the example below explained on this site and thought both answers would
I´m new to the Telerik RadScheduler. I've already saw the example on Telerik site
I was going over C++0x. As i looked at tuple I saw this example.
I saw in an earlier post here on stackoverflow a example on many to
Saw this example on the jQuery examples page for Ajax: var xmlDocument = [create

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.