0

我使用 kaa rest api 来更改我的配置,如下所示:

curl -v -S -u devuser:devuser123 -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"applicationId": "2",
"schemaId": "65539",
"endpointGroupId": "32768",
"body": "{\"timeConfig\":{\"org.kaaproject.configuration.unchangedT\":\"unchanged\"},\"dailySchedules\":{\"org.kaaproject.configuration.unchangedT\":\"unchanged\"},\"enabled\":{\"boolean":false},\"relays\":{\"array\":[false,false,false,true,true,false,false,false]},\"samplePeriod\":{\"int\":9}}",
}' 'http://localhost:8080/kaaAdmin/rest/api/configuration' | python -mjson.tool

但我明白了HTTP/1.1 400 Bad Request。我的帖子参数看起来还可以吗?任何建议将不胜感激。

4

1 回答 1

2

最后我发现了问题。Kaa Rest API 完美运行。这是关于 schemaID 和 endpointgroupId 不匹配的问题。我从 kaa Web 界面获得了正确的值: http://localhost:8080/kaaAdmin/#config:appId=2&endGroupId=32768&create=false&active=true&random=0.19035219790078206&schemaId=65539 . 由于400 ERROR CODERest 文档中不存在 ,因此我不知道问题出在哪里。

于 2017-01-05T13:22:15.890 回答