« Martin Fowler: MultipleCanonicalModels and messaging integration | Main | Ah, that's your name then »

HTML subsets HTTP, breaks web architecture, movie at 11

You can't use PUT or DELETE in a HTML form.

Until recently I thought this was because no-one had bothered to build those calls it into a browser engine. But no:

The method attribute of the FORM element specifies the HTTP method used to send the form to the processing agent. This attribute may take two values:

* get: With the HTTP "get" method, the form data set is appended to the URI specified by the action attribute (with a question-mark ("?") as separator) and this new URI is sent to the processing agent.

* post: With the HTTP "post" method, the form data set is included in the body of the form and sent to the processing agent.
[17.13 Form submission]

What on earth were they thinking?

I used to wonder why web services were so enamoured with POST. Now I know. If web services is anything down in the trenches , then it's the descendent of CGI and form upload. Of course you'd think POST was all there was if all you were ever allowed to do was POST.

So, HTML subsets HTTP. If any other technology did that, there'd be uproar. Yet I don't think the W3C Technical Architecture Group have even discussed this. Why does it break web architecture? Well, instead of using PUT/POST/DELETE in a form against a single resource/URI, I either have to use multiple URIS to operate on a single resource, or I have to tunnel the PUT/DELETE actions though the entity. And all those log out links that act via GET. Truly, deeply, absymal.

July 31, 2003 02:04 PM


Margaret Green
(July 31, 2003 02:27 PM #)

1. I went nuts trying to work from the specs. "Where's PUT?" , I'd imprecate (curse for J. Allen).
2. It was (and is) most counter intuitive to to use GET to send information upstream.
3. I'd always marveled at the RESTafarians righteous indignation at the Web Services initiatives given the partial implementation of HTTP.

Mark Baker
(August 1, 2003 04:00 PM #)

The nature of a form is such that it only needs to support GET and POST. PUT (like DELETE) is something that the browser should do, roughly equivalent to "Save As".

PUT *could* be supported, but need not for forms to in conformance with Web architecture. It also has a weird feel to it that I can't quite explain. If it's important to you, I could write something up in more detail.

Mark Nottingham
(June 6, 2007 11:13 PM #)

If you're really wanting to PUT from an HTML form, try this:

Still half-baked, and JSON-specific, but you get the idea.