Bird
0
0

Which of the following is the correct way to indicate a successful creation of a new resource in a REST API response?

easy📝 Syntax Q12 of 15
Rest API - HTTP Status Codes
Which of the following is the correct way to indicate a successful creation of a new resource in a REST API response?
AHTTP/1.1 201 Created
BHTTP/1.1 404 Not Found
CHTTP/1.1 500 Internal Server Error
DHTTP/1.1 200 OK
Step-by-Step Solution
Solution:
  1. Step 1: Identify the status code for resource creation

    The status code 201 Created is used when a new resource is successfully created on the server.
  2. Step 2: Eliminate incorrect options

    200 OK means success but not necessarily creation; 404 and 500 are error codes.
  3. Final Answer:

    HTTP/1.1 201 Created -> Option A
  4. Quick Check:

    201 Created = New resource created [OK]
Quick Trick: Use 201 Created for new resource success [OK]
Common Mistakes:
  • Using 200 OK instead of 201 for creation
  • Confusing 404 Not Found as success
  • Mixing error codes with success codes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes