码迷,mamicode.com
首页 > 其他好文 > 详细

跨域请求

时间:2019-07-01 10:41:59      阅读:81      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!