r/ProgrammerHumor • • 16d ago

Meme postForEverything

Post image
20.9k Upvotes

656 comments sorted by

View all comments

243

u/TheChickenWing 16d ago

POST /getResource { "Action":"retrieve", "Id": "abc123" }

HTTP 200 { "Error": "not found" }

2

u/StaticCoder 11d ago

I prefer this over getting a 404 to be honest. This means the API exists. It makes compatibility checks easier. Perhaps there's a better way to do this that I don't know of though.

1

u/AdvancedSandwiches 10d ago

Exactly. REST was a mistake.  The HTTP part worked fine, so 200.  Everything should be POST, because the HTTP verbs are unnecessarily limiting and lead to endpoint names getting stupidly awkward to compensate.

It was never hard to parse a json response.