4 ms·
It gets even better: > If the response is not valid JSON, it should be interpreted as an HTTP 503 "Service Temporarily Unavailable" error, and the request shou
by hartror 11y ago
It gets even better:
> If the response is not valid JSON, it should be interpreted as an HTTP 503 "Service Temporarily Unavailable" error, and the request should be retried later.
Why not just return 503?
- mrec 11y agoMaybe it does, normally. But there's always an outside chance that everything's fine at the point you start writing a response, but goes pear-shaped before you finish. This wording just reinforces what's probably common sense, i.e. that there's no reason you'd see invalid JSON other than a hopefully-transient operational issue.
- hartror 11y agoIn what circumstances does a HTTP server/client return to a partially complete response?