November 2009 Archives

Using HTTP PUT and DELETE methods in web applications

I've been thinking about how to make an application I'm currently designing more REST-like. (You'll forgive me if I avoid the atrocious neologism "RESTful.") The HTML forms specification only supports the GET and POST methods for form submission, but if you've ever designed a web service for other HTTP clients, you've probably had a good reason to use PUT and DELETE as well. PUT is an idempotent create operation; sending the same PUT twice will cause the same resource to be created at the same URI, whereas a duplicate POST could have unknown, possibly disastrous side-effects. And HTML forms have no support at all for anything resembling DELETE -- how often have you designed an application that requires a POST to delete an object? That doesn't make sense.

Is there anybody out there?

This is only a test.

About Mike Friedman

user-pic Mike Friedman is a professional computer programmer living and working in the New York City area.