Sunday, February 5, 2012

Feeling like I'm PWNing REST

I'm working hard to make the private API I'm implementing at my current job a RESTful
uri scheme, and I feel like I hit a point of transcendence recently when I decided how to record a user
staring a story.

  • PUT /article/:articleID/favorite/:userID

  • DELETE /article/:articleID/favorite/:userID

I decided
that POST didn't make sense, as you couldn't really favorite a story more than once at
a time, and of course DELETE makes sense here.  Adding them as a relation between the article and the user
seems to make sense in this URI scheme as well.

So, all in all, I'm proud of myself.
 Despite it being such a tiny, simplistic thing.