Android改造2发送数组作为字段

时间:2017-08-20 15:47:48

标签: arrays mapping retrofit2

 @FormUrlEncoded    
 @POST("mobile/order")
 Call<OrderResult> orederTaxi(
        @Field("user_id") Integer user_id,
        @Field("driver_id") Integer driver_id,
        @Field ("locations") List<String> location);

retrofit 2映射数组元素并创建key_value对,如`driver_id:8

locations: 40.7830904,43.861694

locations: 40.789281071949176,43.8663412258029

locations: 40.79531973066005,43.86150989681482

locations: 40.79855839824006,43.85658267885446

但我必须发送一个jsonArray,如:`

locations:[
 "40.7830904,43.861694",
 "40.789281071949176,43.86634122580292",
 "40.79531973066005,43.86150989681482"
]

0 个答案:

没有答案