4 ms·
Something to consider, the author advocates json responses across the board, which is pretty good advice, however, it's incompatible with `204 No Content` respo
by oxtopus 13y ago
Something to consider, the author advocates json responses across the board, which is pretty good advice, however, it's incompatible with `204 No Content` responses (also recommended). If you're building a client that connects to an API that could potentially return a `204 No Content` response, you can't assume that there will be json in the body and automatically parse the response.
- delinka 13y agoI don't see the problem here. You get a 204, you don't expect content. If your consumer hits a URL, ignores status codes, and expects content, You're Doing It Wrong. To me, it looks like the HTTP equivalent of a C function that returns NULL.
- oxtopus 13y agoAgreed. Just throwing it out there since I've encountered it before, more than once, where others assume there will always be a response, regardless of status code.