我需要关于如何在改进请求中使用多个参数'@path'的帮助。我尝试使用单参数'@Path'这种方式工作。在改进URL中制作更多@path
@GET("topics/{id}?userId=58bf87d343c3ccb5793b2e99")
Call<ResponseBody> artikel(@Path("id") String id);
,但我想用两个参数是这样
ApiService.class:
@GET("topics/{id}?userId={userId}")
Call<ResponseBody> artikelFeeds(@Path("id") String id, @Path("userId") String userId);
会抛出错误“路径不能有替换块” ,这是改造的一部分客户端
Call<ResponseBody> get_artikel;
Retrofit retrofit;
retrofit = new Retrofit.Builder()
.baseUrl(Status.HOST_ARTICLE)
.addConverterFactory(GsonConverterFactory.create())
.client(httpClient)
.build();
ApiService apiService = retrofit.create(ApiService.class);
get_artikel = apiService.artikelFeeds(id,userId);
如何注释呢? 'ApiService apiService = retrofit.create(ApiService.class); get_artikel = apiService.artikelFeeds(id,userId);' –
使用相同。没有变化 –
我得到错误代码500,为什么? –