KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In my continuing quest to try and wrap my mind around RESTful-ness, I've come to another place where I'm not sure how to proceed. I set up a thought expiriment for myself where I'd design a simple voting system for a resource, much like how SO allows voting on questions. So, say my resource is an image, and I can get an image by an ID, like so: http://www.mysite.com/images/123123 And in this example, that returns say, a JSON representation of an image, like so: { "URL":"http://www.mysite.com/images/123123.jpg", "Rep":"100" } How would I design a way to "vote" on that image? I'd like two operations; up-vote and down-vote. The client shouldn't know how much weight each carries, because I'd like to have the award for an up-vote/down-vote be decided at the server level so I can change it anytime I like. My first idea was to have something like this: http://www.mysite.com/vote/images?image=123123 To that URL, one could POST something like the following: { "Vote":"UpVote" } But I'm wary of that - to me that says RPC in disguise. Would that be a poor way to design this? If so, what other designs could I try?
Tags (comma-separated)
Save Edits
Cancel