Skip to content Skip to sidebar Skip to footer

Array As Volley Post Request Params

I am trying to make a volley POST request with a array as my parameter, for example I want to POST {'types':[1,2,3]} what I have now is a string {'types':'[1,2,3]'} This is how

Solution 1:

Instead of List, try JSONArray.

JSONArray types=newJSONArray();
types.put(1);
types.put(2);
types.put(3);
jsonObject.put("types", types);
jsonArray.put(jsonObject);

This should fix your issue

Post a Comment for "Array As Volley Post Request Params"