📜  nodejs bodyparser 表单数据 - Javascript代码示例

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

代码示例2
var bodyParser = require('body-parser');
var multer = require('multer');
var forms = multer();

// apply them

app.use(bodyParser.json());
app.use(forms.array()); 
app.use(bodyParser.urlencoded({ extended: true }));

// how to use

router.post('/', function(req, res) {
    console.log(req.body);
    console.log('received the widget request');
});