标签:with service services pre class config web origin header
报错:Access to XMLHttpRequest at ‘http://197.7.50.83:27/WebServices/other/PlaneHandlerJ.ashx‘ from origin ‘http://197.7.50.83:8080‘ has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
修改目标配置文件: Web.config
<customHeaders> <add name="Access-Control-Allow-Methods" value="OPTIONS,POST,GET"/> <add name="Access-Control-Allow-Headers" value="Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"/> <add name="Access-Control-Allow-Origin" value="*" /> </customHeaders>
标签:with service services pre class config web origin header
原文地址:https://www.cnblogs.com/aimyfly/p/11112379.html