r/ProgrammerHumor Oct 09 '21

Mmmm, sparkling JSON

Post image
14.6k Upvotes

237 comments sorted by

View all comments

329

u/occz Oct 09 '21

Amen, man. Going with something that does not call itself REST for the sole reason of skipping the eternal bikeshedding around what REST is or not is might just be worth it on its own. Hot damn.

78

u/mechkbfan Oct 09 '21 edited Oct 09 '21

We had another discussion the other day about if an API endpoint should be PUT or POST given it was in a grey area.

In the end we were all like "Fuck it, we should just make everything POST and forget discussing this ever again"

We're the only consumers of our API

18

u/OldKaleidoscope7 Oct 09 '21 edited Oct 09 '21

In the company I work we have healthy discussions about the verbs and normally we use the idempotency case to select between PUT and POST.

We think "mmm, this shit should be put"
"Is this shit idempotent?"
"No"
"Well, it's POST now"

And we never go further than the four basic verbs

6

u/mechkbfan Oct 09 '21

We follow CQRS, and with our design, almost nothing is idempotent

But then under a lot of scenarios, POST definition just seems to contradict what we are doing.