405 method not allowed Web API

前端 未结 21 1657
栀梦
栀梦 2020-11-27 18:33

This error is very common, and I tried all of the solutions and non of them worked. I have disabled WebDAV publishing in control panel and added this to my web config file:<

21条回答
  •  伪装坚强ぢ
    2020-11-27 18:51

    Chrome often times tries to do an OPTIONS call before doing a post. It does this to make sure the CORS headers are in order. It can be problematic if you are not handling the OPTIONS call in your API controller.

    public void Options() { }
    

提交回复
热议问题