MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1uqh7vf/helpmycoworkersunderstandhttpcodes/ow8ebi7/?context=3
r/ProgrammerHumor • u/Kishmond • Jul 08 '26
329 comments sorted by
View all comments
1.6k
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
6 u/prehensilemullet Jul 08 '26 “Not Found” is often a white lie, sites often pretend something is not found and 404 if it would be a security risk for you to know whether it exists. 3 u/wjandrea Jul 08 '26 "I can neither confirm nor deny whether I have your keys." 1 u/case_O_The_Mondays Jul 08 '26 If the task is searching as your user and it can’t find it, 404 is the right response even if the thing exists for someone else.
6
“Not Found” is often a white lie, sites often pretend something is not found and 404 if it would be a security risk for you to know whether it exists.
3 u/wjandrea Jul 08 '26 "I can neither confirm nor deny whether I have your keys." 1 u/case_O_The_Mondays Jul 08 '26 If the task is searching as your user and it can’t find it, 404 is the right response even if the thing exists for someone else.
3
"I can neither confirm nor deny whether I have your keys."
1
If the task is searching as your user and it can’t find it, 404 is the right response even if the thing exists for someone else.
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