我有一个 web 服务链接,我想以
的形式使用不同的 customerId http://apidev.myserver.com.au:8980/TestService/rest/TestService/jobs/bycustid/customerId
如何附加 customerId 的值?
这是我的基本网址:
http://apidev.myserver.com.au:8980/TestService/rest/TestService/
这是我的调用界面的样子:
interface CustomerJobs {
@GET("jobs/bycustid/11726")
Call<CustomerJobsPojo> getCustomerJobs();
}
最佳答案
作为doc说:
interface CustomerJobs {
@GET("jobs/bycustid/{id}")
Call<CustomerJobsPojo> getCustomerJobs(@Path("id") int id);
}
关于android - 使用 Retrofit 获取 api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42689463/