I am using volley for json parsing. I want to send some data using POST to server side. I am trying to send .Now can any one tell me that how can i send filter array to serv
If you are having a problem in calling the API then this will help you.
RequestQueue queue = Volley.newRequestQueue(this);
JsonObjectRequest jobReq = new JsonObjectRequest(Request.Method.POST, url, jObject,
new Response.Listener() {
@Override
public void onResponse(JSONObject jsonObject) {
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
}
});
queue.add(jobReq);
where jObject is the JSON data you want to send to the server.
Implementation will be similar for JSONArray. Instead of JsonObjectRequest use JsonArrayRequest and send jArray instead of jObject.
For creating json array just do a little tweak
JSONArray array=new JSONArray();
for(int i=0;i
And finally add json array as below
jsonParams.put("filter",array);
In your case you are converting Json array to string