使用postman发送请求,body为空

后端使用nodejs和express框架,并配置body-parser,

const bodyParser = require('body-parser')
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended:false}))

此时发现body还是为空,在postman发送请求时加上请求头: "Content-type" : "application/json;charset=utf-8"

posted @ 2021-12-30 16:27  pangqianjin  阅读(2340)  评论(0编辑  收藏  举报