News for hackers. Stuff that matters.
Re:Show HN: Deck of Cards – A playing card API by dghf on Tuesday May 12, 2015 @03:13AM (#9529999)
> If you used different HTTP methods, you'd already know which one to use, and don't need the action parameter.

But the examples given by anilgulechas were 'action=draw' and 'action=shuffle'. Neither are idempotent, let alone safe, so presumably the only method to use in either case would be POST (notwithstanding anilgulecha's suggestion of a PUT).

So we need to distinguish between POSTs requesting a draw, and POSTs requesting a shuffle. Two options:

a) indicate it in the POST's body

b) indicate it in the URL.

If we go for (b), the query string seems as good a place as any.

What have I got wrong? Where would this violate REST (or the HTTP spec)?

There are no comments on this comment yet.