Add an array as request parameter with Retrofit 2

后端 未结 7 728
故里飘歌
故里飘歌 2020-12-10 11:04

I\'m looking for way to add an int array (e.g [0,1,3,5]) as parameter in a GET request with retrofit 2. Then, the generated url should be like this : http:/

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 11:43

    Using toString didn't work for me. Instead, TextUtils.join(",", ids) does the trick.

    Don't forget to mark the Query with encoded = true.

提交回复
热议问题