I'm Brett Slatkin and this is where I write about programming and related topics. You can contact me here or view my projects.

09 August 2013

Let's remove verbs from HTTP 2.0

Practically speaking there are only two HTTP verbs: read and write, GET and POST. The semantics of the others (put, head, options, delete, trace, connect) are most commonly expressed in headers, URL parameters, and request bodies, not request methods. The unused verbs are a clear product of bike-shedding, an activity that specification writers love.

With HTTP 2.0 maybe we should remove the useless verbs?

Interestingly, HTTP 1.0 only defined GET, POST, and HEAD back in 1996. The rest were added in HTTP 1.1 in 1999. WebDAV and CalDAV added uncommon verbs. PATCH is yet another one. Useless complexity has been seeping into the spec.

All of these new verbs are compromises between spec writers in "stakeholder" companies. In contrast, HTTP 1.0's list of methods was surprisingly lean. That's because they had 5+ years to eliminate the bad ideas. Check out HTTP's definition from 1992 and its crazy list of request methods, like this one:

I shit you not – SPACEJUMP was a verb.


This method is similar to the TEXTSEARCH method, but instead of the search criterion being a text string, it is a set of coordinates defining a point within the image. The semantics of the operation are not defined here. Typically, the user clicks on a point within the image with a mouse or other pointing device.
Two or more coordinates are supplied, in the order x, y z, t. All coordinates are scaled so that 0 represents the bottom left hand point and 1.0 represents the top right hand point.

The z access direction follows the normal right-hand rule, that is extends toward the viewer when the x and y axes are flat as in the normal two-dimensional representation.

In the case of a time-occupying object, 0 represents the starting instance, and 1.0 represents the finishing instant.

The method is implemented using GET with a derived URL.

Hold on… let me get my '90s vintage VR goggles.

The uncommon, unused HTTP verbs are a great example of YAGNI: you ain't gonna need it. The trap of YAGNI is hard to avoid in spec writing. Tim Bray called us out on YAGNI in the PubSubHubbub spec back in 2009. He was totally right. It's hilarious to me now to see my response to him. I was so wrong. PuSH 0.4 removes the useless section.

I think these HTTP spec additions are wrong, too.

We should simplify the HTTP 2.0 spec to match common usage and remove the useless verbs.

PS: It may be worth keeping HEAD just for CORS.
© 2009-2024 Brett Slatkin