I have an ASP.NET MVC 5 controller using attribute routes that doesn't appear to be working with DELETE operations.
[Route("deletealbum/{id}")]
[AcceptVerbs(HttpVerbs.Delete)]
public ActionResult DeleteAlbum(int id)
{
// rest of the code omitted here
return Json(true, JsonRequestBehavior.AllowGet);
}
I explicitly changed the route name to deletename to rule out other route overload conflicts.
The above action does not fire - I get a 404 not found from IIS. However, if I switch the above action to a HttpVerbs.Get
the route is found no problem.
First time in a long time building an API with MVC instead of Web API, and I can't figure out why the route is not firing - it almost looks like any DELETE operations are blocked. I see the same behavior in a different controller - GET works fine, but DELETE operation returns a 404. Is there some configuration setting that needs to be flipped to enable additional verbs perhaps?