You need to add in your http header following line, as described in basic authorization:
The username and password are combined with a single colon.
The resulting string is encoded using the RFC2045-MIME variant of
Base64, except not limited to 76 char/line.
- The authorization method and a space i.e. "Basic " is then put before the encoded string.
Look at example with Apache HttpClient:
String encoding = Base64Encoder.encode ("your_login:your_password");
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();