Which HTTP status code indicates authentication failure (incorrect password) for a REST API request?
Choose an answer
Tap an option to check your answer.
Correct answer: HTTP Status Code: 401.
Why this is the answer
HTTP status code 401 (Unauthorized) is used when the client needs to authenticate to get the requested response. This specifically means the client's credentials (like a password) are missing or incorrect, leading to an authentication failure. HTTP status code 200 (OK) indicates that the request has succeeded. HTTP status code 302 (Found) is a redirection message, meaning the resource has been temporarily moved to a different URI. HTTP status code 504 (Gateway Timeout) indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server. These codes do not signify an authentication failure.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed