raha tamjid raha tamjid - 4 months ago 53
Android Question

Send a JSONArray POST request with android volley library

I would like to send and receive a Json Array with volley.
Now I can receive an array and it's ok but I don't know how to send a request (For example: with post method).

JsonArrayRequest arrayReq = new JsonArrayRequest(URL,
new Listener<JSONArray>() {


The Android Volley team may add it later. For now, create your class that extends JsonArrayRequest, then override getParams():

protected Map<String, String> getParams() throws AuthFailureError {
    HashMap<String, String> params = new HashMap<String, String>();
    params.put("name", "value");
    return params;

Next, make a new constructor:

public PostJsonArrayRequest(String url, Response.Listener<JSONArray> listener, Response.ErrorListener errorListener) {
    super(Method.POST, url, null, listener, errorListener);