min*_*yen 1 rest mongodb node.js postman
我尝试通过邮递员创建 post 方法,但邮递员无法读取请求正文,这是我在索引文件上的代码
app.post('/users', async (req, res) => {
const addUser = new User(req.body)
console.log(req.body)
try {
await addUser.save()
res.status(201).send(addUser)
} catch (e) {
res.status(400).send(e)
}
})
Run Code Online (Sandbox Code Playgroud)
这是我使用邮递员时的捕获
这是终端
http://prntscr.com/qvdvpj的结果
归档时间: |
|
查看次数: |
4261 次 |
最近记录: |