当前位置首页 > IIS知识

EnableAccess-Control-Allow-OrigininIIS6&IIS7forwebapicalls

阅读次数:282 次  来源:admin  发布时间:

To allow your newly created webapi web service calls to be accessed from ajax post calls from another website you need to enable this setting in either IIS6 or IIS7

IIS6

Open Internet Information Service (IIS) Manager Right click the site you want to enable CORS for and go to Properties Change to the HTTP Headers tab In the Custom HTTP headers section, click Add Enter Access-Control-Allow-Origin as the header name Enter * as the header value Click Ok twice

IIS7 – Add this to your web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <system.webServer>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
 </system.webServer>
</configuration>

转自:http://www.figers.com/Blog/2013/03/21/enable-access-control-allow-origin-in-iis6-iis7-for-webapi-calls/

上一篇:软件包管理之Fedora/Redhat软件包管理指南
下一篇:fedora15使用unrar