1 context.Response.ContentType = "text/plain"; 2 //context.Response.Write("Hello World"); 3 context.Response.AddHeader("Access-Control-Allow-Origin", "*"); 4 context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); 5 context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type");
在一般处理程序中增加这上面3行代码即可,其它与原来一直一样写