3
我正在嘗試訂閱Orion和Cosmos。發送給Orion的所有數據都會在沒有任何問題的情況下更新。但是,發佈到http://xxx.xxx.xx.xx:1026/v1/subscribeContext的時候,我發現了以下錯誤:Orion JSON Bad Request
{
"subscribeError": {
"errorCode": {
"code": "400",
"reasonPhrase": "Bad Request",
"details": "JSON Parse Error"
}
}
}
這是JSON字符串我送:
{
"entities": [
{
"type": "Location",
"isPattern": "false",
"id": "Device-1"
}
],
"reference": "http://52.31.144.170:5050/notify",
"duration": "PT10S",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [
"position"
]
}
],
"attributes": [
"position"
]
}
獵戶更新確定的實體是:
{
"type": "Location",
"isPattern": "false",
"id": "Device-1",
"attributes": [
{
"name": "position",
"type": "coords",
"value": "24,21",
"metadatas": [
{
"name": "location",
"type": "string",
"value": "WGS84"
}
]
},
{
"name": "id",
"type": "device",
"value": "1"
}
]
}
我已經嘗試了很多不同的readthedocs示例,並且StackOverflow中的其他響應失敗。
這是哪個版本的?我應該在/ or contextEntities更新Orion之前還是之後調用/ subscribeContext?
Orion上下文代理版本是0.26.1。
預先感謝您。
我已經完成了一個基於curl的快速測試,您使用的逐字消息似乎沒問題(請參閱https://gist.github.com/fgalan/f0f44d5113fa88e4825a)。請問您可以進行相同的測試以檢查機器的運行情況嗎? – fgalan