Bird
0
0

Which HTTP status code should a REST API return when a client requests a resource that does not exist?

easy📝 Conceptual Q2 of 15
Rest API - Error Handling

Which HTTP status code should a REST API return when a client requests a resource that does not exist?

A403
B404
C500
D200
Step-by-Step Solution
Solution:
  1. Step 1: Identify the meaning of each status code

    404 means 'Not Found', 403 means 'Forbidden', 500 means 'Server Error', 200 means 'OK'.
  2. Step 2: Match the scenario

    Requesting a non-existent resource corresponds to 404.
  3. Final Answer:

    404 -> Option B
  4. Quick Check:

    404 is standard for missing resources [OK]
Quick Trick: 404 means resource not found [OK]
Common Mistakes:
  • Using 403 which means forbidden access
  • Using 500 which indicates server error
  • Returning 200 even when resource is missing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes