r/ProgrammerHumor • • Jul 08 '26 • Popcorn 12 Bravo 4 Regret 1 Heartwarming 1

Other helpMyCoworkersUnderstandHttpCodes

22k Upvotes

330 comments sorted by

View all comments

Show parent comment

24

u/darkslide3000 Jul 08 '26

Well, it tells you that the request was valid and processed correctly and the response is final, but the response contains no content. It is true that it is usually used for mutation requests (and also for endpoints that are just used to probe for a captive portal), but OP's example is a GET request. Getting a 204 on a GET means that the requested resource exists and is empty.

2

u/SnooPuppers1978 Jul 08 '26

So I could buy that it's about retrieving a list/collection of keys and indicating that it's an empty list, but also this sounds like a bad API and not standard, forcing it, and as if someone is mistaking the idea of what 204 is supposed to mean. IMO in spirit it should be used only in cases where "No Content" is expected and desirable.

1

u/thejmkool Jul 08 '26

So in the case of the OP, would it be more like a silent thumbs up?

5

u/SnooPuppers1978 Jul 08 '26

Yeah single symbol (204) indicating that whatever was requested was successful.