Select a status-code strategy that preserves HTTP semantics and client recovery.
Priya notices every API response is HTTP 200, including expired token, validation error, and upstream outage. The dashboard says uptime is perfect while customers cannot create projects. Status codes are not a complete error language; they are the first sorting signal. A client should be able to tell whether to authenticate, change the request, retry later, or contact support before parsing a custom string. The trap is making every failure a 200 with success=false, which breaks caches, client libraries, logs, and alerting because the protocol sees success. The opposite trap is forcing clients to reverse-engineer business rules from status codes…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in