post请求(headers里有属性)报错:Request header field xxx is not allowed by Access-Control-Allow-Headers in preflight response

  • post 请求,headers里有属性(xxx)。请求时报错:
XMLHttpRequest cannot load <url>. Request header field xxx is not allowed by Access-Control-Allow-Headers in preflight response.

解决:在后端的Access-Control-Allow-Headers里,添加该 field。

原文地址:https://www.cnblogs.com/cag2050/p/8204223.html