Asp.Net WebConfig全局配置跨域处理
一、Asp.Net WebConfig全局配置跨域处理
相应报文头中增加对应跨域属性和值:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Methods" value="GET" /> </customHeaders> </httpProtocol> </system.webServer> </configuration>
更多:
Ajax跨域请求附带Cookie/Ajax跨域请求附带身份凭证