[code]
public static String postData(URI uri, String session_id){
AndroidHttpClient client = AndroidHttpClient.newInstance("AndroidAgent");
HttpPost request = new HttpPost(uri);
String credentials = ClientMap.PROXIMA_PASSWORD + ":" + session_id;
String base64EncodedCredentials = Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP);
request.addHeader("Authorization", "Basic " + base64EncodedCredentials);
HttpResponse response;
Log.i(TAG, "session id to payment is " +session_id);
try {
response = client.execute(request);
return EntityUtils.toString(response.getEntity());
} catch (IOException e) {
e.printStackTrace();
return null;
} finally {
client.close();
}
}
{/code]
Quote:
I/httpManager﹕ session id to payment is f4c7e8eb9ac182b66329b78d2c1a4747
I/PaymentActivity﹕ {"code":401,"text":"Unauthorized","note":"invalid user session"}
I use this method in the putData to update the user info. Of course this is with my original session.