I am developing a Python web application as a training exercise, and I am looking for my RESTful application.
To this end, I want to be able to handle various types of HTTP actions / verbs, where applicable. For example, if the widget with id 12 is represented by the URI http: // domain / widget / 12 , and I want to give the end user the ability to remove this widget, they should be able to make an HTTP DELETE request against / widget / 12.
However, HTML forms only support GET and POST, as far as I know, so how can I make an HTTP request with "less popular" HTTP actions like DELETE?
Let's say that on the widget 12 view page (returned by the HTTP GET), I want to enable the form with only one submit button to remove this widget. For instance:
<form action="/widget/12" method="DELETE"> <input type="submit" value="Delete Me!" /> </form>
However, he has already established that HTML forms do not support DELETE for a method attribute. So, what is the RESTful way to execute a DELETE request from the client in this situation?
source share