title: Post an array using retrofit 2
body: <p><a href="https://i.stack.imgur.com/uIT8c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uIT8c.png" alt="enter image description here"></a></p>
  
  <p>I need to post an array of attendees as shown in the image above. I tried using Hashmap but it gives some errors and I don't know if it is server-side error or retrofit.
  Here is my code :</p>
  
  <p>API interface</p>
  
  <pre><code>    @FormUrlEncoded
      @POST("vendor/event/{id}/checkin")
      Call&lt;DefaultResponse&gt; updateAttendance(
              @Path("id") int id,
              @QueryMap Map&lt;String,String&gt; attendees,
              @Field("token") String token);
  </code></pre>
  
  <p>Response class</p>
  
  <pre><code>String message;
  
      public DefaultResponse(String message) {
          this.message = message;
      }
  
      public String getMessage() {
          return message;
      }
  </code></pre>
  
  <p>And here is the code of my Activity</p>
  
  <pre><code>    final Map&lt;String,String&gt; attendees = new HashMap&lt;&gt;();
      for (int i = 0; i &lt; attendeesTables.size(); i++){
              attendees.put("id", String.valueOf(attendeesTables.get(i).getId()));
              attendees.put("arrival_time", 
              attendeesTables.get(i).getArrival_time());
           }
      if (attendeesTables.size() &gt; 0) {
              Call&lt;DefaultResponse&gt; call = RetrofitClient.getmInstance().getApi().updateAttendance(event_id,attendees,token);
              call.enqueue(new Callback&lt;DefaultResponse&gt;() {
  
          @Override
          public void onResponse(Call&lt;DefaultResponse&gt; call, Response&lt;DefaultResponse&gt; response) {
              Toast.makeText(EventsDetailsActivity.this, response.code()+"", Toast.LENGTH_SHORT).show();
              Toast.makeText(EventsDetailsActivity.this, response.isSuccessful()+"", Toast.LENGTH_SHORT).show();
            }
  
          @Override
          public void onFailure(Call&lt;DefaultResponse&gt; call, Throwable t) {
              Toast.makeText(EventsDetailsActivity.this, t.getMessage(), Toast.LENGTH_SHORT).show();
              }
          });
        }
  </code></pre>
  
  <p>Am I doing everything in the right way?
  I get request code 400(bad request)</p>