Missing token 'access-control-allow-headers' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel

后端 未结 3 900
粉色の甜心
粉色の甜心 2020-12-15 05:39

I have two VS projects : one exposing MVC5 controllers, the other being an angular client. I want the angular client to be able to query the controllers. I read numerous thr

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-15 06:24

    Oftentimes, the threads that I read were suggesting several unecessary configuration steps, which created confusion. It's actually very simple...

    For the simple purpose of sending a cross site request, from an angular client, to an ASP controller :

    • No angular interceptors are required.
    • No custom filters on the server side are required.
    • The only mandatory modification is to add this in the server's web.config

      
            
                
                    
                    
                    
                
           
      
      

提交回复
热议问题