http.createServer((request, response) => {
response.setHeader('Access-Control-Allow-Origin','*')
request.on('data', data => { console.log(data)
})
request.on('end', () => { console.log(request)
response.end('success')
})
}).listen(8088)在请求的时候,如果传参为String类型的,可以成功,但是如果请求Object类型的,就报错:Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.请问我应该怎么写啊
- 2 回答
- 0 关注
- 1179 浏览
添加回答
举报
0/150
提交
取消