UNIT error_code":282004
乱嗜枭雄1 发布于2020-06 浏览:1106 回复:1
0
收藏

按照例程,C语言直接写成json字符串格式是可以的,如下:

static char *UNIT_data = "{\"bot_session\":\"\",\"log_id\":\"123456\",\"request\":{\"bernard_level\":1,\"client_session\":\"{\\\"client_results\\\":\\\"\\\", \\\"candidate_options\\\":[]}\",\"query\":\"打开电视\",\"query_info\":{\"asr_candidates\":[],\"source\":\"KEYBOARD\",\"type\":\"TEXT\"},\"updates\":\"\",\"user_id\":\"**********\"},\"bot_id\":\"***********\",\"version\":\"2.0\"}";

 

但是如果想把query的内容更换,直接把static char *test= “关闭电视”;字符串替换“打开电视”,就会提示error_code":282004,[{\"request.query\":\"query字段不能空\"}] invalid or missing"} ,明明打印显示已经替换成功了,为什么还是判断为空呢?

替换query内容后的打印:

{"bot_session":"","log_id":"123456","request":{"bernard_level":1,"client_session":"{\"client_results\":\"\", \"candidate_options\":[]}","query":"关闭电视","query_info":{"asr_candidates":[],"source":"KEYBOARD","type":"TEXT"},"updates":"","user_id":"*********"},"bot_id":"***********","version":"2.0"}

收藏
点赞
0
个赞
共1条回复 最后由乱嗜枭雄1回复于2020-06
#2乱嗜枭雄1回复于2020-06

已解决

0
TOP
切换版块