【发布时间】:2020-06-14 02:51:56
【问题描述】:
我正在尝试使用 Retrofit 我的自定义对象从 Parse Server 获取。
http 请求是:
https://MY.SERVER./1/classes/Fiestas?where={"Epoca":{"__type":"Pointer","className":"Epocas","objectId":"myObjectId"}}
所以我有这个界面:
@GET("Fiestas?where={\"Epoca\":{\"__type\":\"Pointer\",\"className\":\"Epocas\",\"objectId\":\"{epoca_id}\"}}")
fun getFiestaByEpocaId(@Path("epoca_id") epoca_id: String): Deferred<JSONResponse>
但我收到此错误:
java.lang.IllegalArgumentException: URL query string "where={"Epoca":{"__type":"Pointer","className":"Epocas","objectId":"{epoca_id}"}}" must not have replace block. For dynamic query parameters use @Query.
for method FiestaApi.getFiestaByEpocaId
有人知道在 kotlin 的 GET 改造请求中发送 JSON 的任何解决方案吗?
谢谢!
【问题讨论】: