Stack Exchange
HTTP Request Android programmatically
I want to make http post request with this format
{
  "Request":{
     "Data":{
      "RMID":"0910403545",
      "QID":"151",
      "RC":"5010",
      "Alg":"IMEI",
      "AlgID":"987654321",
      "IPD":"1223331",
      "Now":"27-01-2013"
  },
     "Signature":"5a185c480d11ebd39675977e40af34fe4a0121aa"
  }
}

I have tried in my android app, here the code ..
AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();
JSONObject object = new JSONObject();
object.put("RMID", "0910403545");
object.put("QID", "151");
object.put("RC", "5010");
object.put("Alg", "IMEI");
object.put("AlgID", "987654321");
object.put("IPD", "1223331");
object.put("Now", "27-01-2013");
params.put("Data", object.toString());
params.put("Signature", "5a185c480d11ebd39675977e40af34fe4a0121aa");
client.post(link, params, new AsyncHttpResponseHandler(){
    @Override
    public void onSuccess(String response) {
    // TODO Auto-generated method stub
        Log.d("XXX", response);
    }

    @Override
    public void onFailure(Throwable error, String response) {
        // TODO Auto-generated method stub
        Log.d("XXX", response);
    }
});

the response was not i have expected. it's different if i tried in javascript.

try to post the same data in the post body, with https://addons.mozilla.org/en-us/firefox/addon/restclient/ hope you will find some clue

I think you missed to put "Request":{} in your code

thanks QAMAR, because of your link i have solved my problem.

you are welcome, +1 on my comment please
