我正在使用curl(curl http://localhost:8080/send -H "Content:Type: application/json" -d @data.json
)向我的节点js应用程序发送一个json对象。
在调试它之后,使用node-inspector,我似乎在req.body中获得了以下内容:{ "sender_id": 1 }: ""
,这是我所期望的除了尾随:“”。现在,当我尝试req.body["sender_id"]
时,我得到了未定义。不知道发生了什么事。