Bruce Tate on Ruby and REST

August 13, 2006

Gernot Starke points to this article by Bruce Tate. Nice try, unfortunately including some misleading statements:

Rather than inventing an exhaustive list of standards, REST uses existing Internet standards, including HTTP, XML, and TCP/IP.

Maybe true for a RESTful application, but not for REST itself.

REST clients use the same HTTP commands as your browser to access resources.

Except for PUT and DELETE.

The HTTP commands map to CRUD like this:

The analogy isn’t very good, anyway, but if it’s used, PUT should map to update and POST to create.

But anyway, not bad, and good to see REST get most exposure.

About

This page contains a single entry from Stefan Tilkov's Random Stuff posted on August 13, 2006 10:35 PM. The previous post in this blog was Split Personality Author. The next post in this blog is Atom Protocol Exerciser. Many more can be found on the main index page or by looking through the archives.

Comments

I just want to point out that there seems to be no consensus whether PUT or POST should be used for creating resources. After reading the HTTP 1.1 RFC I came to the conclusion that POST is for updating and PUT for creating new resources.

Posted by: Sebastian Stein at August 15, 2006 1:42 PM | link

I disagree. The spec says “The PUT method requests that the enclosed entity be stored under the supplied Request-URI. “, which means that you need a URI to store something (and will later be able to retrieve its representation from the same URI). To me, this implies an update.

A POST often creates a new subordinate resource, such as a new item in a forum thread, and returns a new URI; but it can also do almost anything else that is not “safe” and/or “idempotent”. As I said, the analogy isn’t very good.

Posted by: Stefan Tilkov at August 15, 2006 2:12 PM | link