问题可能是因为请求的参数,应该设置为字符串。如:
curl -X POST -H "Content-Type: application/json" -d '{"message": "foo"}' http://localhost:8080/messages
问题可能是因为请求的参数,应该设置为字符串。如:
curl -X POST -H "Content-Type: application/json" -d '{"message": "foo"}' http://localhost:8080/messages
问 body-parser 出现Unexpected token u in JSON at position 1 错误