I'm trying to authenticate to a web server from an android class with the org.apache.http.HttpClient.
How can I do this? The code for my connection is:
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet("url");
HttpResponse response = null;
try {
response = httpClient.execute(httpGet);
} catch (ClientProtocolException e) {
...
} catch (IOException e) {
...
}
Log.i("httptest", response.getStatusLine().toString());
HttpEntity entity = response.getEntity();
Edit
I want to do a basic authentication with username and password