title: Android Retrofit - Pass list of objects as associative array
body: <p>I have an API which expects a list of exercises as input:</p>
  
  <pre><code>exercises[0][duration]=10
  exercises[0][type]=jump
  exercises[1][duration]=20
  exercises[1][type]=roll
  </code></pre>
  
  <p>On Android side, I have my API class built using Retrofit. </p>
  
  <p>How do I pass my <code>List&lt;Exercise&gt;</code> to the API method in order to get the above parameters.</p>
  
  <p>Currently tried:</p>
  
  <pre><code>@FormUrlEncoded
  @POST("api/v1/patient/{id}/workout")
  fun addPatientWorkout(@Path("id") id: Long,
                        @Field("title") title: String,
                        @Field("exercises[]") exercises: List&lt;Map&lt;String,String&gt;&gt;)
          : Single&lt;Response&lt;Workout&gt;&gt;
  </code></pre>
  
  <p>But that does not give what I expect. Instead:</p>
  
  <p><code>exercises[]={duration:10, type=jump}&amp;exercises[]={duration:20, type=roll}</code></p>