且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

请求头字段的访问控制允许报头没有被访问控制允许,允许标题

更新时间:2023-01-08 23:10:44

服务器(即POST请求被发送到)需要包括访问控制允许-headers 头(ETC)的在其回应。将它们放在你的请求来自客户端没有任何效果。

The server (that the POST request is sent to) needs to include the Access-Control-Allow-Headers header (etc) in its response. Putting them in your request from the client has no effect.

这是因为它是由服务器来指定它接受跨域请求(以及它允许​​内容类型请求头,等等) - 客户端无法自行决定给定服务器应该允许CORS

This is because it is up to the server to specify that it accepts cross-origin requests (and that it permits the Content-Type request header, and so on) – the client cannot decide for itself that a given server should allow CORS.