gpt4 book ai didi

fiware - 不能在实体的属性值中使用括号 ( )

转载 作者:行者123 更新时间:2023-12-01 05:00:08 27 4
gpt4 key购买 nike

过去几天我一直在用 Orion 进行试验,一段时间后,我让它按照我想要的方式工作。

但是,我遇到了一个意想不到的烦恼,即给定实体上下文的字符串属性将无法注册。

例子:

http POST [my_orion_server_url]:1026/v1/updateContext < create_push.json

create_push.json 在哪里:
{
"contextElements": [
{
"type": "Push",
"isPattern": "false",
"id": "Push1",
"attributes": [
{
"name": "message",
"type": "string",
"value": "this is a test)"
}
]
}
],
"updateAction": "APPEND"
}

服务器回复:
HTTP/1.1 200 OK
Content-Length: 129
Content-Type: application/json
Date: Thu, 19 Nov 2015 11:47:03 GMT

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

另一方面,如果我删除括号,一切都会按预期进行:

json文件:
{
"contextElements": [
{
"type": "Push",
"isPattern": "false",
"id": "Push1",
"attributes": [
{
"name": "message",
"type": "string",
"value": "this is a test"
}
]
}
],
"updateAction": "APPEND"
}

服务器响应:
{
"contextResponses": [
{
"contextElement": {
"attributes": [
{
"name": "message",
"type": "string",
"value": ""
}
],
"id": "Push1",
"isPattern": "false",
"type": "Push"
},
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
]
}

这是故意的还是错误?

我可以克服用其他东西对括号进行编码然后在接收时解码的问题,但是能够直接用实体发送括号会更顺畅,也不会那么烦人。

最佳答案

这是预期的行为。请看 Orion documentation .

关于fiware - 不能在实体的属性值中使用括号 ( ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33803291/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com