我try 向我的 node 服务器发送一些表单数据,但req.body
在 node 端没有我的表单字段
var express = require('express')
var app = express()
var path = require('path')
var bodyParser = require('body-parser')
app.use(bodyParser.urlencoded({
extended: true
}));
app.get('/', function (req, res) {
res.sendFile('index.html')
})
app.post('/sendmail', function (req, res) {
const formData = req.body.formData
这是我从浏览器发送的内容
fetch('/send', {
method: 'POST',
body: new FormData(form)
})
在开发工具中,我只看到在Referer中传递的数据,这可能是我的问题