Develoraptor Blog

Login

How do you implement a delete button in HTML?

How do you implement a delete button in HTML?

My method is this:
Given the resource I want to delete is at /resou
urce
I create a form that sends a POST request to /resource!!. Then on the server, before I get to the router, I change the method to DELETE and drop the !! from the path. Now in the router I can pretend it's a DELETE request and everything becomes a bit more RESTful.