每一种美,都会有一双眼睛能看到;每一份爱,总会有一颗心会感受到。

跨域请求

报错: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>

  

posted @ 2019-07-01 09:45  温暖向阳Love  阅读(246)  评论(0编辑  收藏  举报