Fiware IoAgent json教程错误

Fiware IoAgent json教程错误,fiware,fiware-orion,Fiware,Fiware Orion,在本教程中: 当我执行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/context

在本教程中:

当我执行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"
}
}
如何解决这个问题

Cumps

似乎您正在“混合”来自NGSIv1和NGSIv2的URL样式:)我的意思是,它应该是:

/v2/entities/LivingRoomSensor/attrs/sleepTime

我建议始终使用NGSIv2,因为它是Orion context Broker提供的更强大、更灵活、更简单的上下文管理API版本。

通过更改以下内容解决:

localhost:1026/v1/contextEntities/LivingRoomSensor/attrs/…

localhost:1026/v1/contextEntities/LivingRoomSensor/attrs/…
localhost:1026/v1/contextEntities/LivingRoomSensor/attribute‌​s/…