Web API - 405 - The requested resource does not support http method 'PUT'

前端 未结 10 621
说谎
说谎 2020-12-01 14:10

I have a Web API project and I am unable to enable \"PUT/Patch\" requests against it.

The response I get from fiddler is:


HTTP/1.1 405 Method Not Al         


        
10条回答
  •  -上瘾入骨i
    2020-12-01 14:46

    This answer fixed the issue for me. I had to add the Route attribute and the problem was solved.

        [HttpPut]
        [Route("")]
        public HttpResponseMessage MyMethod()
    

提交回复
热议问题