News for hackers. Stuff that matters.
Re:Rules for REST API URI Design by icebraining on Monday June 19, 2017 @02:08AM (#14584874)
Creating a new resource for everything sounds very tedious though. A simple example might be upvoting. I think taking a step away from REST and making a /upvote action makes for an easier to consume API.

How are you imagining the REST equivalent? Because that's also what I'd do: create a /post/<id>/upvote URL that the client would just have to POST to. That's perfectly RESTful, you're creating a new upvote, you don't have to care about the resulting resource if you don't need to manipulate it further.

To do this restfuly you could maybe update a virtual "state" field to the desired state, but to me that can feel very unnatural.

Why?

There are no comments on this comment yet.