Im trying to create a httpGet that returns a similar request as :
http://www.myserver.com/do.json?json={\"magazine\":\"-1\"}
I can\'t seem to get the header
HttpGet get;
HttpParams httpParameters;
try
{
httpParameters = new BasicHttpParams();
String auth = android.util.Base64.encodeToString(
(username + ":" + userpwd).getBytes("UTF-8"),
android.util.Base64.NO_WRAP
);
HttpGet request = new HttpGet(StaticURL.uMain+resourceURI);
request.addHeader("Authorization", "Basic "+ auth);
HttpConnectionParams.setSoTimeout(httpParameters, timeoutConnection);
client = new DefaultHttpClient(httpParameters);
response = client.execute(request);
userAuth = EntityUtils.toString(response.getEntity());
System.out.println("Data. in login.."+userAuth);
}
catch(Exception e)
{
System.out.println("Error.."+e);
}
note: use Base64 api externally