Hi, I saw an example in StackOverflow that 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 like this. I tried using the same code but could not find the Base64Encoder class anywhere. I am using httpclient-4.1.2.jar and httpcore-4.1.2.jar. Can someone help me with this?
source share