Kindlehighlight Quote by Paul Dix
““For invalid user name and password combinations, the service should return a 400 HTTP status code, which means that the server received a “bad request.” The service could also use the 401 (“unauthorized”) response code, but that code specifies that authentication credentials need to be in the request header, which is not quite what is required.””
About This Quote
The technical note explains why a 400 status is appropriate for invalid credentials, rather than 401.
In simple terms: Use 400 Bad Request for bad login data.
Apply correct HTTP status codes.
Themes
Mood
Type
When to use this quote
- API design
- backend services
- client validation
Key Concepts
Questions to Reflect On
- When should 401 be used instead?
- How does status choice affect client behavior?
Choosing the wrong code can mislead developers.