我正在通过tcp套接字将此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。
答案 0 :(得分:1)
在该链接的所有示例中,“参数”是一个对象,而不是一个 array 。这个事实正是错误消息告诉您的(尽管我承认,但说的不是很清楚)。
只需更改
{"method":"Playlist.Clear","id":1,"jsonrpc":"2.0","params":[{"playlistid":1}]}
到
{"method":"Playlist.Clear","id":1,"jsonrpc":"2.0","params":{"playlistid":1}}