Bird
0
0

A developer returns this response after creating a resource:

medium📝 Debug Q6 of 15
Rest API - HTTP Status Codes
A developer returns this response after creating a resource:
HTTP/1.1 200 OK
{"id": 202}

Why might this be considered improper REST API design?
ABecause the status code should be 404 Not Found
BBecause the response body is missing
CBecause 200 OK means the request failed
DBecause 200 OK does not indicate resource creation
Step-by-Step Solution
Solution:
  1. Step 1: Identify the status code meaning

    200 OK means the request succeeded but does not specify resource creation.
  2. Step 2: Best practice for creation

    201 Created is the correct status code to indicate a new resource was created.
  3. Final Answer:

    Because 200 OK does not indicate resource creation -> Option D
  4. Quick Check:

    Use 201 for creation, not 200 [OK]
Quick Trick: 201 Created signals resource creation, not 200 OK [OK]
Common Mistakes:
MISTAKES
  • Using 200 OK for resource creation
  • Assuming 200 OK means creation happened
  • Ignoring status code semantics

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes