【发布时间】:2018-09-30 18:01:51
【问题描述】:
在 Orion 我可以创建订阅:
curl localhost:1026/v2/subscriptions -s -S --header 'Content-Type: application/json' \
-d @- <<EOF
{
"description": "A subscription to get info about Room1",
"subject": {
"entities": [
{
"id": "Room1",
"type": "Room"
}
],
"condition": {
"attrs": [
"pressure"
]
}
},
"notification": {
"http": {
"url": "http://localhost:1028/accumulate"
},
"attrs": [
"temperature"
]
},
"expires": "2040-01-01T14:00:00.00Z",
"throttling": 5
}
EOF
在本例中,Orion 将在服务器 http://localhost:1028/accumulate 上执行 POST 请求。有没有办法从 Orion 收到的 POST 中检索响应?即 200、404...
在我的用例中,通知执行 POST 请求以在另一台服务器上创建一些资源。 POST 返回所创建资源的位置。检索这些位置会很有用。
【问题讨论】:
-
“在 Orion 中我可以创建通知”。您的意思是“创建订阅”吗?
-
是的,已更正。
标签: fiware-orion