Why no methods for “PUT, DELETE” in HTML?

Carlos Pineda
3 min readDec 2, 2019

--

While learning about RESTful routs in Sinatra and Rails for my Module 2 code challenge (mainly based on Rails) and I remember learning how GET and POST requests get passed automatically through the browser as such:

In this example, I’m trying to run a cow adoption agency for aliens, so I have to create a cow. When you create a cow (marie), it’s a simple POST request.

When you inspect the button you see the underlying HTML specifies the method as “post”:

When we want to delete our cow (a.k.a. put it up for adoption), we create a delete button to get it done:

When we again look into the underlying HMTL in the browser, it appears as another POST method. It does, however, have an input type “hidden” in which it passes the method which we actually want as an underlying input.

But why???? This come down to browsers not allowing us to send HTTP requests using any other verb than GET or POST. The way I understand it, there are two possible rationales for it

  1. The two methods supported by browsers that essentially to one of two things: you either read information (GET) or write information (POST). Since PUT and DELETE essentially do the same as POST, they are essentially “sub-categories” of POST, therefore no need to directly support more methods in HTML.
  2. When HTML forms were originally created, they supported only GET and POST methods. When the need arose for PUT and DELETE methods, developers simply created a work around and pass them as a sub-type of a POST request. Since these have worked until now (and pretty much standard practice) there is no need to create the support for it, therefore nobody has taken the time to write up the comprehensive specifications needed for it.

Either way, looks like it wont be changing anytime soon.

If you’d like to read further into this I recommend you check this out: https://softwareengineering.stackexchange.com/questions/114156/why-are-there-are-no-put-and-delete-methods-on-html-forms

--

--