I have a ASP.NET MVC app. I have single function pattern which will be called both with HTTP POST and HTTP DELETE.
Although Post is called, Delete is never called. I confirmed that the IIS accepts HTTP Delete. Any comments?
Route and Controllers:
routes.MapHttpRoute(
name: "RegisterCard",
routeTemplate: "{version}/cards/{cardID}",
defaults: new { Controller = "MyController", Action = "
routes.MapHttpRoute(
name: "UnregisterCard",
routeTemplate: "{version}/cards/{cardID}",
defaults: new { Controller = "MyController", Action = "Delete" });
[HttpPost]
public async Task<HttpResponseMessage> Post(string version, string cardID);
{
}
[HttpDelete]
public async Task<HttpResponseMessage> Delete(string version, string cardID);
{
}