Recall & Review
beginner
What does the HTTP status code 200 OK mean?
It means the request was successful, and the server has returned the requested data or completed the action.
Click to reveal answer
beginner
When should a server respond with 201 Created?
When a new resource has been successfully created as a result of the client's request, the server responds with 201 Created.
Click to reveal answer
intermediate
What is a common difference between 200 OK and 201 Created responses?
200 OK means the request succeeded generally, while 201 Created specifically means a new resource was made.
Click to reveal answer
intermediate
In REST APIs, what should the server include in the response when sending 201 Created?
The server should include a Location header with the URL of the newly created resource.
Click to reveal answer
beginner
True or False: A 200 OK response can be used for both GET and POST requests.
True. 200 OK is a general success status and can be used for many request types, including GET and POST.
Click to reveal answer
Which HTTP status code indicates a resource was successfully created?
✗ Incorrect
201 Created means the server successfully created a new resource.
What does a 200 OK status code usually mean?
✗ Incorrect
200 OK means the request was successful.
When responding with 201 Created, what should the server include?
✗ Incorrect
The Location header tells the client where to find the new resource.
Can 200 OK be used for a successful POST request?
✗ Incorrect
200 OK can be used for any successful request, including POST.
Which status code is NOT appropriate for a successful resource creation?
✗ Incorrect
404 Not Found means the resource was not found, so it is not appropriate for creation success.
Explain the difference between 200 OK and 201 Created in REST APIs.
Think about when you create something new versus just getting data.
You got /3 concepts.
Describe when and why a server should use the 201 Created status code.
Focus on resource creation and client notification.
You got /3 concepts.