I am trying to send data via post method of AsyncHttpClient in json format to server, server accept this format
{
email : 'foo@bar.com'
password:'xxxxxx'
'username:'John Doe'
'lastname:'john'
}
and this is my code
JSONObject params = new JSONObject();
params.put("last_name","Karimi");
params.put("username","zahid");
params.put("email","zahid.omerzad@gmail.com");
params.put("password","1234566");
StringEntity entity = new StringEntity(params.toString());
Log.d("entity3",entity+"");
String url = "http://192.168.100.12/users";
client.post(context, url, entity, "application/json", handler);
when I log the entity the result is shown as below
[Content-Type: text/plain; charset=ISO-8859-1,Content-Length: 496,Chunked: false]
please help me?