为什么不使用Retrofit2 Android对查询参数进行编码

时间:2018-09-22 06:15:24

标签: android kotlin retrofit2

我的问题是在发送到服务器之前对查询参数进行编码。我正在使用Retrofit2 API服务客户端。

我的请求:@GET("/Categories/70/{category}")

fun getPLPList(@Path("category") category: String, @QueryMap(encoded = true) map: Map<String, String>): Observable<PLPModel>

我已经启用flag encoded=truitut,但对我来说无效。

Api请求:https://api-test.net/Categories/CL/70/cat450012?orderBy=5

预期输出:https://api-test.azurewebsites.net/Categories/CL/70/cat450012?orderBy%3D5

0 个答案:

没有答案