by stevepotter on 12/8/10, 2:20 AM with 6 comments
For example, say I have a project management system. And you can archive a project. How should my REST API handle archival?
I assume you'd do a POST to myapp.com/project/1234, and you'd pass some data in like { archived: true }.
Or maybe a POST to: myapp.com/project/1234/archive. Although I guess that URL is not restful.
So what's the approach that most apps take here? A generate "update" action that takes varying parameters, rather than individual actions for each method, would be a bit of a pain to code and document, no?
by jsarch on 12/8/10, 3:33 AM
by rmk on 12/8/10, 2:26 AM
So you could do: curl -X PUT -d "<params>" http://myapp.com/project/1234
See section 11.6 (How to take snapshots of resources) in the book "RESTFul web services cookbook" for a discussion of this...
by spooneybarger on 12/8/10, 3:26 AM
by steveklabnik on 12/8/10, 3:31 AM