[英]Error registering Weather Forcast data model (NGSI v2)
I am trying to register weather forcast on ContextBroker
V1.5.0 but getting below error :- 我正在尝试在
ContextBroker
V1.5.0上注册天气预报,但出现以下错误:-
400 Bad Request { "error": "BadRequest", "description": "attribute must be a JSON object, unless keyValues option is used" } 400错误的请求{“错误”:“ BadRequest”,“描述”:“属性必须是JSON对象,除非使用keyValues选项”“
Request: POST http://[ContextBroker IP]:1026/v2/entities 请求:POST http:// [ContextBroker IP]:1026 / v2 / entities
Request header : Content-Type:application/json 请求标头:Content-Type:application / json
Here is the payload 这是有效载荷
{
"feelsLikeTemperature":31.8,
"dayMinimum":{"feelsLikeTemperature":31.8,"temperature":0.0,"relativeHumidity":31.0},
"temperature":0.0,
"dateCreated":"2016-12-01T12:05:00+05:30",
"type":"WeatherForecast",
"address":{"addressCountry":"IN","postalCode":"452001","addressLocality":"Indore"},
"windSpeed":3.7,
"validity":{"to":"2016-12-01T06:44:37Z","from":"2016-12-01T06:44:37Z"},
"source":"http://dataservice.accuweather.com/",
"precipitationProbability":0,
"dayMaximum":{"feelsLikeTemperature":31.8,"temperature":0.0,"relativeHumidity":31.0},
"weatherType":"Partly sunny",
"windDirection":"ENE",
"id":"452001_IN_YYYY-12-DD ",
"relativeHumidity":31.0
}
I verified with FIWARE
data models on http://fiware-datamodels.readthedocs.io/en/latest/Weather/WeatherForecast/doc/spec/index.html but it does not seem to be working. 我在http://fiware-datamodels.readthedocs.io/en/latest/Weather/WeatherForecast/doc/spec/index.html上使用
FIWARE
数据模型进行了验证,但似乎无法正常工作。 Does anyone know solution to this problem? 有人知道解决这个问题的方法吗?
you are using the 'keyValues' representation so you need to do your POST with ?options=keyValues 您正在使用'keyValues'表示形式,因此需要使用?options = keyValues进行POST
by the way the WeatherForecast data model just landed updated with some adjustments to comply with GSMA specification. 顺便说一下,WeatherForecast数据模型刚刚进行了更新,并进行了一些调整以符合GSMA规范。
http://fiware-datamodels.readthedocs.io/en/latest/Weather/WeatherForecast/doc/spec/index.html http://fiware-datamodels.readthedocs.io/en/latest/Weather/WeatherForecast/doc/spec/index.html
thanks! 谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.