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.請問我應(yīng)該怎么寫啊
node.js設(shè)置Content-Type
繁星淼淼
2018-07-22 09:06:07