跨域請求

報錯: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.blog

 

修改目標配置文件: Web.configit

<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>
相關文章
相關標籤/搜索