Sometimes WebAPI returns 405 in cases where it should return 404. If there is no possible verb to satisfy a URL, then it should be 404.
Consider an empty controller:
class TestController : ApiController {
}
Today. calls to GET Api/Test will return a 405. It should be 404.
Comments: Verified. I used the following controller for verification: Request: GET http://localhost:9095/api/values public class ValuesController : ApiController { // POST api/values public void Post([FromBody]string value) { } // PUT api/values/5 public void Put(int id, [FromBody]string value) { } // DELETE api/values/5 public void Delete(int id) { } }
Consider an empty controller:
class TestController : ApiController {
}
Today. calls to GET Api/Test will return a 405. It should be 404.
Comments: Verified. I used the following controller for verification: Request: GET http://localhost:9095/api/values public class ValuesController : ApiController { // POST api/values public void Post([FromBody]string value) { } // PUT api/values/5 public void Put(int id, [FromBody]string value) { } // DELETE api/values/5 public void Delete(int id) { } }