后端使用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"

后端使用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"

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。