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行代码即可,其它与原来一直一样写

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-03-03
  • 2021-10-14
  • 2022-12-23
相关资源
相似解决方案