no actions in the URL
during a short exchange on the REST discuss list today, someone asked the best way to REST-ify a publish/draft toggle for a web URI:
I've got articles in the system, and when I first add them they're in
draft mode. At some point I can publish them to make them public.
And at any time I can toggle between draft or published mode.
i replied thusly:
subbu pointed out the major flaw in my suggestion:
But that looks like a method-oriented URI and not a resource-oriented
URI. For example, what would
and bob haugen (blog?) puts it all out there:
Alternatively, you could
(the state of which is either "draft" or "published")
Because that is literally what you are doing, changing the state of mode of the article, which appears to be somewhat independent of changing the state of the contents of the article.
lesson (re)learned: keep 'actions' out of the URI
thanks bob and subbu for the gentle whack on the back of the head.