retrofit 参数传数组

Call checkIds(@Query("product_ids[]") String[] ids);

String[] ids = new String[]{"3", "4"};
service.checkIds(ids).enqueue()

生成的就是浏览器传递数组的通用格式

http://101.201.153.152/api/checkids?product_ids[]=3&product_ids[]=4

你可能感兴趣的:(retrofit 参数传数组)