orion 上下文代理的无效字符

Invalid characters for orion Context Broker

我调用上下文代理来创建元素,但有时会出现以下错误:

{
    "errorCode": {
        "code": "400", 
        "details": "Illegal value for JSON field", 
        "reasonPhrase": "Bad Request"
    }
}

我做了一些测试,发现有些字符会出现错误。

我发现属性值中带有“(”、“)”、“'”、“>”、“<”、...字符的 return 那个错误。

这是创建实体的示例,return 错误:

(curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{   
    "contextElements": [
        {   
            "type": "Room",
            "isPattern": "false",
            "id": "Room1",
            "attributes": [
            {   
                "name": "temperature",
                "type": "float",
                "value": "23"
            },
            {   
                "name": "pressure",
                "type": "integer",
                "value": "720"
            },
            {   
                "name": "floor",
                "type": "string",
                "value": "3 (B)"
            }
            ]
        }
    ],
    "updateAction": "APPEND"
}
EOF

this section in the Orion user manual.

中解释了无效字符(以及对它们进行编码的基本原理和建议)