更新时间:2022-05-20 22:38:26
服务器(POST 请求发送到的服务器)需要包含 Access-Control-Allow-Headers
标头(等)在其响应中.将它们放入客户的请求中没有任何效果.
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.
这是因为由服务器指定它接受跨域请求(并允许 Content-Type
请求标头等)——客户端无法决定本身,给定的服务器应该允许 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.