繁体   English   中英

错误注册天气预测数据模型(NGSI v2)

[英]Error registering Weather Forcast data model (NGSI v2)

我正在尝试在ContextBroker V1.5.0上注册天气预报,但出现以下错误:-

400错误的请求{“错误”:“ BadRequest”,“描述”:“属性必须是JSON对象,除非使用keyValues选项”“

请求:POST http:// [ContextBroker IP]:1026 / v2 / entities

请求标头:Content-Type:application / json

这是有效载荷

 {
    "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
}

我在http://fiware-datamodels.readthedocs.io/en/latest/Weather/WeatherForecast/doc/spec/index.html上使用FIWARE数据模型进行了验证,但似乎无法正常工作。 有人知道解决这个问题的方法吗?

您正在使用'keyValues'表示形式,因此需要使用?options = keyValues进行POST

顺便说一下,WeatherForecast数据模型刚刚进行了更新,并进行了一些调整以符合GSMA规范。

http://fiware-datamodels.readthedocs.io/en/latest/Weather/WeatherForecast/doc/spec/index.html

谢谢!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM