com.fasterxml.jackson.core.JsonParseException: Unrecognized token was expecting (‘true’, ‘false’ or ‘null’)

  • A+
所属分类:ajax Spring

springboot中ajax向后台传入json数据时报错

com.fasterxml.jackson.core.JsonParseException: Unrecognized token was expecting ('true', 'false' or 'null')

data : {"name" : "abcd"}

 

需要加上JSON.stringify(),问题解决。

JSON.stringify() 方法是将一个JavaScript值(对象或者数组)转换为一个 JSON字符串

data : JSON.stringify({"name" : "abcd"})

 

ZPY

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: