title: Volley Post request ,Send Json object in Json array request
body: <p>To say in simple words i want to send  this <code>{&quot;Id&quot;:7,&quot;Name&quot;:&quot;MyName&quot;}</code> data To server using Volley Post Request.</p>
  <p>It has 1 integer and 1 String  and response i get is Jsonarray</p>
  <p>I tried Following ways but none are working</p>
  <ul>
  <li><p>as it is json array request i cannot send data in argument as 3rd argument only takes JsonArray and i have to send JsonObject so kept it as null</p>
  <p><code>new JsonArrayRequest(Method,Url,JsonArray,ResponseListener,ErrorListner)</code></p>
  </li>
  <li><p>I cannot put it in <code>HashMap</code> as 1 of the value is integer, and it only accepts string</p>
  </li>
  </ul>
  <p>getparams() method</p>
  <pre><code>@Override
  protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
      Map&lt;String,String&gt; params=new HashMap&lt;&gt;();
      params.put(&quot;Id&quot;,7); //            &lt;====== This is Invalid
      params.put(&quot;Name&quot;,&quot;MyName&quot;);
      return params;
  }
  </code></pre>
  <ul>
  <li>I tried to send in getbody method ,still not working</li>
  </ul>
  <p>getbody method</p>
  <pre><code>@Override
  public byte[] getBody() {
      String body=&quot;{\&quot;Id\&quot;:7,\&quot;Name\&quot;:\&quot;MyName\&quot;}&quot;;
      return body.getBytes();
  }
  </code></pre>
  <p>I can get the response using HttpUrlConnection.</p>
  <p>Is there any other way to achieve it in volley ?</p>