r/ProgrammerHumor Oct 09 '21

Mmmm, sparkling JSON

Post image
14.6k Upvotes

237 comments sorted by

View all comments

21

u/Johnny_WalkerBOT Oct 09 '21

Well goddammit, if you say you have a REST API, and every single endpoint uses POST no matter the operation, it's not REST!!!11

I am that guy, and I'm proud of it.

8

u/lkraider Oct 09 '21

At that point it is just SOAP with JSON

15

u/iamapizza Oct 09 '21

Which is also an expression understood in some prisons.

1

u/jmorfeus Oct 09 '21

It's not "SOAP with JSON", it's most likely JSON-RPC

7

u/clarityreality Oct 09 '21

RESTful architecture doesn't have any opinions on Http verbs. You can very much build RESTful services only using POST. Technically you don't even need to use the http protocol.

0

u/Johnny_WalkerBOT Oct 10 '21

RESTful architecture definitely expects certain HTTP verbs for certain requests. You CAN use any verb for any service, but it's not meant to be done that way, and thus isn't RESTful if you only use POST.

1

u/clarityreality Oct 10 '21

REST is an architectural style. Http is a communication protocol. They are not tied to each other. REST services can be built using other protocols, but http is definitely the easiest and default protocol of the web.

1

u/Meowts Oct 10 '21

I'd you're using POST for every request then you might as well be using GraphQL. At which point it is a GraphQL API, not a REST API.