【发布时间】:2018-11-06 20:38:01
【问题描述】:
我通过 tcp-socket 将这个 json 发送到我的 raspi-kodi-client。
{"method":"Playlist.Clear","id":1,"jsonrpc":"2.0","params":[{"playlistid":1}]}
但他回了我:
{"error":{"code":-32602,"data":{"method":"Playlist.Clear","stack":{"message":"Invalid type object received","name":"playlistid","type":"integer"}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"}
为什么???看起来我太笨了,因为不同的例子看起来一样
First Example - ok its http not tcp but I dont think thats the point - but maybe it is :O
我正在使用 kodi 1.7 和 openjdk 11。
【问题讨论】:
-
在该链接的所有示例中,“params”是一个 object,而不是 array。而这个事实正是错误信息告诉你的(虽然我承认,它并没有说得很清楚)。
-
@Adyon 我刚才说:我太笨了。谢谢。它奏效了。