This is a single archived entry from Stefan Tilkov’s blog. For more up-to-date content, check out my author page at INNOQ, which has more information about me and also contains a list of published talks, podcasts, and articles. Or you can check out the full archive.

GET Requests Updating the Database

Stefan Tilkov,

Simon Harris:

The HTTP methods should be used to indicate the user’s intention without regard to the underlying implementation. The web application is an abstraction so we need to model the interaction on that abstraction. If the user’s intention is to make a change to something then go ahead and use a PUT but if they’re only reading some data use a GET even if you know it involves some database writes.

It may seem somewhat esoteric but spending a bit of time thinking about what the user’s intention is exactly has helped me better flesh out an application’s API.

I have the same experience: The CRUD analogy may help when you start “getting” REST, but you should leave it behind as soon as you can.

On April 15, 2008 11:46 AM, duryodhan said:

This is all pretty nicely explained in the HTTP RFC. Only after reading the RFC did it all become clear. For a standards document, it is suprisingly readable.