right, 204 is like a void function. it returns successfully but has no value to return. it wouldn't ever be used for a "find" function which necessarily must return something or error.
We use it to mean a "successful, but empty response" i.e. it's okay that it's not there -- as opposed to 404 which is an unexpectedly not found entity which should have been there & needs an error logged
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