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

后端 未结 11 581
庸人自扰
庸人自扰 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:43

    I just added custom headers to the Web.config and it worked like a charm.

    On configuration - system.webServer:

    
      
        
        
      
    
    

    I have the front end app and the backend on the same solution. For this to work, I need to set the web services project (Backend) as the default for this to work.

    I was using ReST, haven't tried with anything else.

提交回复
热议问题