Asp.Net WebApi2 Enable CORS not working with AspNet.WebApi.Cors 5.2.3

后端 未结 11 521
庸人自扰
庸人自扰 2020-11-27 11:06

I tried to follow the steps at http://enable-cors.org/server_aspnet.html to have my RESTful API (implemented with ASP.NET WebAPI2) work with cross origin requests (CORS Enab

11条回答
  •  清酒与你
    2020-11-27 11:36

    WEBAPI2:SOLUTION. global.asax.cs:

    var cors = new EnableCorsAttribute("*", "*", "*");
    config.EnableCors(cors);
    

    IN solution explorer, right-click api-project. In properties window set 'Anonymous Authentication' to Enabled !!!

    Hope this helps someone in the future.

提交回复
热议问题