public class ServiceRequestController : ApiController
public IHttpActionResult Post([FromBody]ServiceRequest.Models.ServiceRequest serviceRequest)
I use an empty
This throws an error stating
HTTP Error 405.0 - Method Not Allowed
and most likely causes given were
- The request sent to the Web server used an HTTP verb that is not
allowed by the module configured to handle the request
A request was sent to the server that contained an invalid HTTP verb
The request is for static content and contains an HTTP verb other
than GET or HEAD
A request was sent to a virtual directory using the HTTP verb POST
and the default document is a static file that does not support HTTP
verbs other than GET or HEAD.
However if use Route("Test"), the method
just works fine
as like below:
[POST] to http://localhost.com:59985/ServiceRequest/Test
-- works fine.
(Route is [Route("Test")])
[POST] to http://localhost.com:59985/ServiceRequest
------- does not work
(Route is [Route("")]
not allowed for POST ?
Any ideas what is wrong here ?