📜  node express json request urlencoded - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:40.287000             🧑  作者: Mango

代码示例2
var express = require('express')

var app = express()

app.use(express.json()) // for parsing application/json
app.use(express.urlencoded({ extended: true })) // for parsing application/x-www-form-urlencoded

app.post('/profile', function (req, res, next) {
  console.log(req.body)
  res.json(req.body)
})