ASP.NET MVC: so POST == DELETE, eh?
2009-02-01
ok, i put my code where my mouth was. i posted an example that shows how easy it is to support
HTTP DELETEin modern browsers. no need to overloadPOSTat all.
i read this post today and saw this bit of ASP.NET MVC code and i died a little inside:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete(int id) {
//Delete that stuff!
}
AYFKM? srsly?
please, i'm begging you. stop ignoring the full set of HTTP methods. i covered this faux paux already .
with all the might and power of MSFT; all the creativity that went into building the MVC library for ASP.NET; all the effort made to integrate the fantasic jQuery client-side library into the ASP.NET MVC; and you -still- ignore PUT and DELETE?
it's not because you don't have ability. you've got the best possible set of tooling and libraries available on the Windows platform!
[sigh]...
people, if someone stands up and stage or in front of a class and shows you this code and tells you it's an acceptable way to do things, just. say. no.
i'm not kidding.