In my ASP.NET MVC application, I want to use this ASP.NET MVC Attribute Based Route Mapper, first announced here.
I am trying to do a RESTful API using this, and I don't understand how to differentiate from Get vs. post.
The GET is found, but when I try to POST, the route doesn't map, and I get a 404. Please advise.
See Code:
[HttpGet]
[Url("organizations/{organizationId?}/alerts/", Order = 1)]
public JsonResult List(Guid? organizationId) {
...
return Json(data, JsonRequestBehavior.AllowGet);
}
[HttpPost]
[Url("organizations/{organizationId?}/alerts/", Order = 2)]
public JsonResult Send(Guid? organizationId, string message) {
...
return Json(data, JsonRequestBehavior.AllowGet);
}