【发布时间】:2015-10-17 18:58:21
【问题描述】:
在他们的示例 (http://square.github.io/retrofit) 中,第三个代码块似乎检索 List<Repo> 类型的数据,但是从字符串到 JSON 数组到 List<Repo> 的转换发生在哪里?我对 Retrofit 的工作原理有点迷茫。
在尝试用我自己的 REST api 复制它时,(json -> List<User>)...
java.lang.IllegalArgumentException: Could not locate call adapter for java.util.List<com.keenant.app.User>.
【问题讨论】:
-
你知道 Retrofit 是开源的吗?只需检查代码:github.com/square/retrofit 您看到的代码 sn-ps 只是顶级代码,可以轻松深入了解 Retrofit 的使用。这不是为了解释内部的东西
-
如果您想要更具体的答案,请发布 JSON 和您的
User课程。
标签: java android json retrofit