android - 使用 Retrofit 获取 api

标签 android retrofit retrofit2

我有一个 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/

相关文章:

c# - 在 Unity 中使用协程

java - 由于错误而无法启动基本应用程序(UnsupportedOperationException : Can't convert to dimension: type=0x1)

android - 将 CookieHandler 与 OkHttp 和 Retrofit 2 一起使用

Android Retrofit AES 加密/解密 POST 和响应

android - ScrollView 中的全屏布局

java - 安卓游戏性能

android - 为 greenDao 和改造创建通用数据模型

java - 搜索URL中的汉字编码

android - RxJava : How to handle error with zip operator ?

android - 错误 : elements in annotation type declarations cannot declare formal parameters