问题描述
我通过将josn发送到弹性搜索将数据上传到弹性搜索服务器,它工作正常,但在某些字符上,例如\\它给出错误,当我在json中发送反斜杠时&&如果我转储响应的json,它将给出错误
"{"error": {"caused_by": {"reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes", "type": "not_x_content_exception"}, "reason": "failed to parse", "root_cause": [{"reason": "failed to parse", "type": "mapper_parsing_exception"}], "type": "mapper_parsing_exception"}, "status": 400}"
我的jon字符串是
"{
"first_name":"muhammad irfan",
"middle_name": "",
"last_name":"ulhaq choudhary",
"address":"H,no,197,St,no. 157. G-9\\4",
"city":"Islamabad",
"phone_number1":"",
"phone_number2":"",
"phone_number3":"",
"gender":"M",
"updation_time":"0000-01-01",
"country_id":"1"
}
"
1楼
我不知道您使用哪个包裹。
但是您可以尝试使用\\\\\\\\
代替\\\\
。