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)在請(qǐng)求的時(shí)候,如果傳參為String類型的,可以成功,但是如果請(qǐng)求Object類型的,就報(bào)錯(cuò):Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.請(qǐng)問(wèn)我應(yīng)該怎么寫(xiě)啊
node.js設(shè)置Content-Type
波斯汪
2018-07-15 14:18:07