在改造中,我们为每个API调用指定需要使用的每个@Path
参数,例如:
@GET("slider/{app-key}/{category}")
Call<ArrayList<SliderContent>> getSliderInfo(@Path("app-key") String appKey,
@Path("category") String categoryKey);
在将@Path
参数传递给类似这样的东西时,我试图使API调用更通用:
@GET("slider/{app-key}/{category}")
Call<ArrayList<SliderContent>> getSliderInfo(@Path("type?") String... body);
// Where body[0] corresponds to @Path("app-key") String appKey
// body[1] corresponds to @Path("category") String categoryKey
问题是:
@Path
,@Header
,@Query
),翻新改造可能无法区分参数。@Path
字符串的数组或集合。