【发布时间】:2019-12-06 08:41:18
【问题描述】:
尝试实现与 TestRail API(http://docs.gurock.com/testrail-api2/accessing) 交互的自定义解决方案,我有点陷入以下情况:
Api 调用是这样进行的:/index.php?/api/v2/get_case/1,这意味着在任何东西之后“?”是一个查询字符串参数.有没有办法通过 Retrofit 对其进行参数化?
如果我这样做:
@GET("index.php?/api/v2/get_case/{id}")
Call<TestCase> getTestCase(@Query("id") int id);
我得到了这个例外:
java.lang.IllegalArgumentException: URL query string "/api/v2/get_case/{id}" must not have replace block. For dynamic query parameters use @Query.
知道了...但是如何继续使用 Retrofit?
【问题讨论】:
标签: retrofit retrofit2 okhttp testrail