Node.js · Junior · Question 64 of 75

Which HTTP status code should an API return when a resource is created?

Explanation

201 is the standard answer to a successful POST that creates something, often with a Location header. 204 means success with no body, common for DELETE.

Further reading

Problem with a question

Node.js · Junior · question 64

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz