iotagent-json教程错误
iotagent-json tutorial error
在本教程中:https://github.com/telefonicaid/iotagent-json/blob/master/docs/stepbystep.md
当我执行 curl 时:
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Fiware-Service: myHome" -H "Fiware-ServicePath: /environment" -H "Cache-Control: no-cache" -d '{
"value" : "300"
}' 'http://localhost:1026/v1/contextEntities/LivingRoomSensor/attrs/sleepTime'
我收到此错误响应:
{
"orionError" : {
"code" : "400",
"reasonPhrase" : "Bad Request",
"details" : "service not found"
}
}
如何解决这个问题?
胸罩
看来你是来自 NGSIv1 和 NGSIv2 的 "mixing" URL 风格 :) 我的意思是,它应该是:
/v2/entities/LivingRoomSensor/attrs/sleepTime
或
/v1/contextEntities/LivingRoomSensor/attributes/sleepTime
我的建议始终是使用 NGSIv2,因为它是 Orion Context Broker 提供的更强大、更灵活和更简单的上下文管理版本 API。
通过更改解决:
localhost:1026/v1/contextEntities/LivingRoomSensor/attrs/…
至
localhost:1026/v1/contextEntities/LivingRoomSensor/attributes/…
在本教程中:https://github.com/telefonicaid/iotagent-json/blob/master/docs/stepbystep.md
当我执行 curl 时:
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Fiware-Service: myHome" -H "Fiware-ServicePath: /environment" -H "Cache-Control: no-cache" -d '{
"value" : "300"
}' 'http://localhost:1026/v1/contextEntities/LivingRoomSensor/attrs/sleepTime'
我收到此错误响应:
{
"orionError" : {
"code" : "400",
"reasonPhrase" : "Bad Request",
"details" : "service not found"
}
}
如何解决这个问题?
胸罩
看来你是来自 NGSIv1 和 NGSIv2 的 "mixing" URL 风格 :) 我的意思是,它应该是:
/v2/entities/LivingRoomSensor/attrs/sleepTime
或
/v1/contextEntities/LivingRoomSensor/attributes/sleepTime
我的建议始终是使用 NGSIv2,因为它是 Orion Context Broker 提供的更强大、更灵活和更简单的上下文管理版本 API。
通过更改解决:
localhost:1026/v1/contextEntities/LivingRoomSensor/attrs/…
至
localhost:1026/v1/contextEntities/LivingRoomSensor/attributes/…