How to post array in retrofit android

前端 未结 7 1798
旧巷少年郎
旧巷少年郎 2020-11-27 19:55

How can I post following parameter in retrofit through post method ?

 \"params\":{\"body\": {
    \"learning_objective_uuids\": [
      \"ED4FE2BB2008FDA9C81         


        
7条回答
  •  感动是毒
    2020-11-27 20:07

    I've found a new workaround:

    you can send it as a String:

    @POST("CollectionPoints")
    @FormUrlEncoded
    Call postSomething(@Field("ids")String ids);
    

    and send pass it like this:

    Call call = service.postSomething("0","0", Arrays.toString(new int[]{53551, 53554}));
    

    Best Regards!

提交回复
热议问题