gpt4 book ai didi

java - Kodi JSON-RPC over TCP 无效消息

转载 作者:行者123 更新时间:2023-12-02 10:37:31 24 4
gpt4 key购买 nike

我通过 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”是一个对象,而不是数组。这个事实正是错误消息所告诉您的(尽管我承认,它并没有说得很清楚)。

简单地改变

{"method":"Playlist.Clear","id":1,"jsonrpc":"2.0","params":[{"playlistid":1}]}

{"method":"Playlist.Clear","id":1,"jsonrpc":"2.0","params":{"playlistid":1}}

关于java - Kodi JSON-RPC over TCP 无效消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53171743/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com