The requested resource does not support http method 'OPTIONS'.?

前端 未结 6 1291
青春惊慌失措
青春惊慌失措 2020-12-06 01:43

I am making the following request to an asp.net web api PUT method from my angular.js client:

var org = {
                  OrgId: 111,
                  nam         


        
6条回答
  •  庸人自扰
    2020-12-06 01:53

    Yep, an oldie but a goodie. I had the same problem and symptom but my resolution was self-inflicted. I'll share it anyway. The way our service configured the controller used in all of the MapHttpRoute calls at startup included the [DisableCors] attribute. As soon as I reconfigured my local machine startup to use a different controller, everything worked. So if you've done everything else listed here then check your controller and make sure you didn't do something stupid, like I did.

提交回复
热议问题