ajax请求,fastjson报出错误:syntax error, expect {, actual error, pos 0
fastjson
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
项目地址:https://gitcode.com/gh_mirrors/fastj/fastjson
·
报错信息如下:
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: syntax error, expect [, actual error, pos 0, fieldName null; nested exception is com.alibaba.fastjson.JSONException: syntax error, expect [, actual error, pos 0, fieldName null
将ajax请求的参数转换成字符串。
用js的JSON.stringify方法将data对象转换成JSON字符串就可以了。
$.ajax({
data:JSON.stringify(data),
});
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
最近提交(Master分支:3 个月前 )
c942c834 - 2 年前
5bc4709b - 2 年前
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)