200-901 · Question #476
Which HTTP response code is returned from a successful REST API call to create a new resource?
The correct answer is A. 201. HTTP 201 Created is the standard response for a successful POST request that results in a new resource being created. It indicates the request was fulfilled and a new resource now exists-often with a Location header pointing to the new resource's URL. 204 No Content (B) means…
Question
Which HTTP response code is returned from a successful REST API call to create a new resource?
Options
- A201
- B204
- C302
- D429
How the community answered
(36 responses)- A92% (33)
- B3% (1)
- D6% (2)
Explanation
HTTP 201 Created is the standard response for a successful POST request that results in a new resource being created. It indicates the request was fulfilled and a new resource now exists-often with a Location header pointing to the new resource's URL. 204 No Content (B) means success but with no body returned, typically used for DELETE or PUT. 302 Found (C) is a redirect. 429 Too Many Requests (D) is a rate-limiting error. For RESTful APIs, distinguishing 200 OK (general success) from 201 Created (resource creation success) is a key design principle.
Topics
Community Discussion
No community discussion yet for this question.