POST发送JSON数据报错了:
JSON parse error: Unexpected character ('t' (code 116)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('t' (code 116)): was expecting double-quote to start field name\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 2, column: 6]"
意思阐释:
SON分析错误:意外字符(“t”(代码116)):字段名称应该以双引号开头;嵌套异常为com . fasterxml . Jackson . core . jsonparseexception:意外字符(“t”(代码116)):应该在【Source:(org . spring framework . util . stream utils $ NonClosingInputStream】处以双引号开始字段名;第2行第6列】“
报错的原因:正确的书写格式是这样的,发送前后端都要加双引号:
{
"title": "1",
"content": "Hello World"
}