Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 48
    Relying on HTTP status codes only works if every "link in the chain" is HTTP. The moment this payload gets saved to a DB, enqueued to a message queue, etc., then HTTP status codes no longer exist, so you end up need to fold them into your payload, anyway Commented Mar 23, 2022 at 1:45
  • 2
    @Alexander: I don't see why you would keep these. I found it a better design to generate them at one end of a pipeline and consume them at the other; if the response is large enough the whole thing is never materialized in RAM at once. Commented Mar 23, 2022 at 19:54
  • 5
    It's different layers, that's all. You wouldn't put the TCP handshake status in there either, right? Commented Mar 24, 2022 at 12:23
  • 7
    Basically the HTTP status can be seen as the status of the "transport layer", while the JSON status response is from the "application layer" (note the double-quotes; no nit-picking, please!) Commented Mar 24, 2022 at 12:25
  • 1
    @U.Windl I know what you mean - I think the names are technically incorrect but you get the point across. It's been a while for me too... Commented Mar 24, 2022 at 12:27