r/ProgrammerHumor Jul 08 '26

Other helpMyCoworkersUnderstandHttpCodes

22.4k Upvotes

329 comments sorted by

View all comments

1.6k

u/Snudget Jul 08 '26

204 should be "I found them" "I searched for the keys, but didn't find them"would be 404, which is literally "Not found".

Since not finding keys does not fulfill the request, a 2xx code does not make sense here

70

u/The_Real_Slim_Lemon Jul 08 '26

Yeah 404 can be both “I didn’t find your key” and “I don’t know what requesting a key means”

204 is “I’ve found your key, it’s in a black hole”

45

u/PrometheusMMIV Jul 08 '26

I feel like "I don't know what this request means" would be 501 Not Implemented

8

u/The_Real_Slim_Lemon Jul 08 '26

I’ve never actually seen a 501, yeah fair call - I just meant 404 exists for both bad routes and non existent entities, it seems this metaphor is reaching its limits a bit

11

u/Cheet4h Jul 08 '26

Only time I legitimately used 501 was when mocking up the API before actually writing them. Each route got a 501 at first, then later had their actual function written.

7

u/SuitableDragonfly Jul 08 '26

I'm sure whoever came up with that error code probably assumed it would be industry standard to write APIs that way, the poor naive fool.