关于 webapi ajax进度条信息设置

1、Web.config 设置跨域

<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE,OPTIONS" />
</customHeaders>
</httpProtocol>

2、Global.asax中配置OPTIONS

protected void Application_BeginRequest()
{
if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OPTIONS")
{
Response.Flush();
}
}
上一篇:JavaScript实现数组转置


下一篇:ALGO-115_蓝桥杯_算法训练_和为T(枚举)