title: JSONArray format in POST Request
body: <p>I am trying to send a <strong>list of items</strong> in the following <strong>format</strong> in a POST request using Volley but server is receiving null.</p>
  
  <p><a href="https://i.stack.imgur.com/ffGDd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ffGDd.png" alt="enter image description here"></a></p>
  
  <p>Here is my Model Class:</p>
  
  <pre><code>public class SaveSettingsBO {
  private int Id;
  private String Key;
  private int Value;
  
  public SaveSettingsBO(int id, String key, int value) {
      this.Id = id;
      this.Key = key;
      this.Value = value;
  }
  
  public int getId() {
      return Id;
  }
  
  public void setId(int id) {
      this.Id = id;
  }
  
  public String getKey() {
      return Key;
  }
  
  public void setKey(String key) {
      this.Key = key;
  }
  
  public int getValue() {
      return Value;
  }
  
  public void setValue(int value) {
      this.Value = value;
  }
  }
  </code></pre>
  
  <p>Java Code for this:</p>
  
  <pre><code>    List&lt;SaveSettingsBO&gt; paramsList = new ArrayList&lt;&gt;();         
      paramsList.add(new SaveSettingsBO(0, "Paymentmethod", 1));
  
      Gson gson = new Gson();
  
      HashMap&lt;String, Object&gt; serviceParams = new HashMap&lt;String, Object&gt;();
      serviceParams.put("accountSettingList", gson.toJson(paramsList));
  </code></pre>
  
  <blockquote>
    <p>Is there a proper way to send array in request like this?</p>
  </blockquote>
  
  <p>Or we should modify request to something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/3VOBW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3VOBW.png" alt="enter image description here"></a></p>