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 = new JSONObject();
        JSONObject jsonObject2;
        try {
            jsonObject.put("minLat", 15.0);
            jsonObject.put("minLng", 140);
            ...

            jsonObject2 = new JSONObject().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"