Skip to content Skip to sidebar Skip to footer

Volley Send Jsonarrayrequest Via Post With Jsonobject Data

I would like to create JsonArrayRequest using Volley POST but I need to put JSON parameters to the request which look like this {'filter':{'minLat':15.0,'minLng':14.0,'maxLng':12.

Solution 1:

If not too late and your issue hasn't been solved. IMO, you can init your JSONOjbect like the following:

JSONObject jsonObject = newJSONObject();
        JSONObject jsonObject2;
        try {
            jsonObject.put("minLat", 15.0);
            jsonObject.put("minLng", 140);
            ...

            jsonObject2 = newJSONObject().put("filter", jsonObject);               
        } catch (JSONException e) {
            e.printStackTrace();
        }

Then, use jsonObject2 in your request. Hope this helps!

Post a Comment for "Volley Send Jsonarrayrequest Via Post With Jsonobject Data"