I am using volley library. I have the following API url http://example.com/project/contriller/ and need to post the json request as body {\"function\":\"getList\",\"pa
Please check below two options for that.
Option1
Try to send data in Map variable as below, and put this code just above you are calling request using Post as below.
Map<String, String> postParam= new HashMap<String, String>();
postParam.put("function", "getList");
postParam.put("latitude", "10.0086575");
postParam.put("token", "");
new JsonObjectRequest(url, postParam, new Response.Listener<JSONObject>() { ... });
option2
You can use below to send direct JSON.
final JSONObject jsonData = new JSONObject("{\"function\":\"getList\",\"parameters\":{\"latitude\":\"10.0086575\",\"longitude\":\"76.3187739\"},\"token\":\"\"}");
new JsonObjectRequest(url, jsonData, new Response.Listener<JSONObject>() { ... });