News for hackers. Stuff that matters.
Re:Show HN: Deck of Cards – A playing card API by crimsonalucard on Monday May 11, 2015 @02:07AM (#9522993)
Why conform to arbitrary conventions when they don't make sense? Personally I think the best reason to conform to REST is because the user expects a "good" api to conform. Other then that is there any hard reason as to why it's "better" to strictly follow REST or even follow it at all?

Is an api that is consistent, fast and documented well, but uses only GET requests for everything including state changes really a horrible api?

Re:Show HN: Deck of Cards – A playing card API by vog on Monday May 11, 2015 @02:48AM (#9523106)
> Is an api that [...] uses only GET requests for [...] state changes really a horrible api?

Yes, it is. Because HTTP clients (including browser) rely on the common method properties as defined by the HTTP standard (GET having no side effects, PUT being idempotent, etc.). The simplest example is caching / proxying, but there is other behaviour.

I strong recommend acutally taking a look at the HTTP standard. The RFCs such as RFC 7231 are well organized and human readable. For the definition of the HTTP verbs, see:

  RFC 7231 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

  4.2 Common Method Properties
https://tools.ietf.org/html/rfc7231#section-4.2
Re:Show HN: Deck of Cards – A playing card API by alexhill on Monday May 11, 2015 @02:49AM (#9523110)
I agree with the spirit of your post, but using the right HTTP verbs can have real, actual consequences because of how some caches and clients behave. You're more likely to accidentally send multiple requests or get stale data when you're using GET.