
Answer-first summary for fast verification
Answer: HTTP 401
The correct HTTP error response for invalid credentials is HTTP 401 (Unauthorized). This status code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. This is appropriate for scenarios where a user fails to provide valid login credentials. HTTP 404 indicates that the resource could not be found, HTTP 503 indicates server unavailability, and HTTP 505 indicates an HTTP version not supported error.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.