遇到的问题
当遇到下面这样的问题:
{ "code": 400, "msg": "JSON parse error: Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries\n at [Source: (PushbackInputStream); line: 3, column: 3]", "data": null }
原因分析
这是原先的json格式的代码,问题在于第一行数据的后面少写了个逗号。
{ "username": "keafmd" "password": "111111" }
解决办法
加上逗号即可解决问题:
{ "username": "keafmd" , "password": "111111" }
解决效果
以上就是遇到【Unexpected character (’"’ (code 34)): was expecting comma to separate Object entries】的解决办法的全部内容。