簡體   English   中英

iotagent-json教程錯誤

[英]iotagent-json tutorial error

在本教程中: https : //github.com/telefonicaid/iotagent-json/blob/master/docs/stepbystep.md

執行卷曲時:

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

要么

/v1/contextEntities/LivingRoomSensor/attributes/sleepTime

我的推薦始終使用NGSIv2,因為它是Orion Context Broker提供的上下文管理API的更強大,更靈活和更簡單的版本。

通過更改解決:

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM