Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Drawing a card is definitely a GET.

I see where you're coming from ("I'm drawing / taking / GETting some cards"), but drawing cards is not an idempotent action. I would implement it as a POST.



In some sense you are PATCHing the deck by removing a card.


I've yet to see a case for PATCH that couldn't be solved with more clarity for everyone involved by a new resource.


I think it's more of a terminology thing, rather than 'GET me a card' you could 'POST remove 2 cards from the deck' and the side effect is the response tells you which cards were deleted.

But this kind of bike shedding drives me mad because oh my lord who gives a crap just build software and document it properly.


I give a crap, because when I see an API, I expect a GET to be idempotent. If a coworker implemented this, there would be words.


Same here. Working on a large codebase where people "just build software and document it properly" without following standards is not fun. Not to mention that frequently people end up shortening that to "just build software". It's better to get in the habit of following good standards even on small projects before bad habits form.


It's not necessarily bike shedding though. GET and POST have two different, widely-agreed upon semantic meanings. It's not just terminology.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: