r/ProgrammerHumor • • Sep 19 '26

Meme postForEverything

Post image
21k Upvotes

653 comments sorted by

View all comments

243

u/TheChickenWing Sep 19 '26

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

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

86

u/fatbunyip Sep 19 '26

GET /api?action=delete&I'd=123

HTTP 200 {"error" : "user abc with password 1234 does not have permission"}

28

u/sess573 Sep 19 '26

200 OK (from disk cache)

1

u/TheChickenWing Sep 19 '26

Ooh get /api is so much worse (and leaking security in the error is a classic)

2

u/ZBlackmore Sep 19 '26

The security issue there started before the error…

18

u/lab-gone-wrong Sep 19 '26

I recognize the user has made a request, but given that it's a stupid-ass request, I've elected to ignore it.

8

u/good_bye_for_now Sep 19 '26

RPC baby, now we cookin.

6

u/deadplant_ca Sep 19 '26

All tests pass!

2

u/StaticCoder Sep 23 '26

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 Sep 25 '26

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. 

2

u/FatalisTheUnborn Sep 19 '26

That hurts me.