Bird
0
0

What does the HTTP status code 401 Unauthorized indicate in a REST API?

easy📝 Conceptual Q11 of 15
Rest API - HTTP Status Codes
What does the HTTP status code 401 Unauthorized indicate in a REST API?
AThe client is not authenticated or provided invalid credentials.
BThe client is authenticated but does not have permission to access the resource.
CThe requested resource was not found on the server.
DThe server encountered an internal error while processing the request.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the meaning of 401 Unauthorized

    The 401 status code means the client must authenticate itself to get the requested response. It usually means no or bad login info.
  2. Step 2: Differentiate from 403 Forbidden

    403 means the client is authenticated but lacks permission. 401 means no valid authentication.
  3. Final Answer:

    The client is not authenticated or provided invalid credentials. -> Option A
  4. Quick Check:

    401 Unauthorized = No or bad login info [OK]
Quick Trick: 401 means login problem; 403 means no permission [OK]
Common Mistakes:
MISTAKES
  • Confusing 401 with 403
  • Thinking 401 means resource missing
  • Assuming 401 means server error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes