random memes }

REST notes

REST Web Services Create a URL to each resource. The resources should be nouns, not verbs. For example, do not use this:


Note the verb, getPart. Instead, use a noun:


To this I would add the modification, use instead:


In the KISS spirit this does the right thing most of the time without further elaboration. Typically the response to URLs containing "?" query strings are not cached. This is the right default as applications typically cannot return a meaningful "last-modified" time without extra work. So no extra work always returns the correct (uncached) response - by default.

Of course, if you do want to put in the extra work, and it makes sense for your application, you could add the modification time to the response header. The point is that the simplest form is always correct if you use a query string, and optimization is still possible.