Recall & Review
beginner
What does HTTP status code 200 mean?
Status code 200 means "OK". It indicates that the request was successful and the server returned the requested data.
Click to reveal answer
beginner
When should you use status code 201 in a Node.js API?
Use status code 201 "Created" when a new resource has been successfully created, such as after a POST request that adds data.
Click to reveal answer
intermediate
What is the difference between status codes 400 and 404?
Status code 400 "Bad Request" means the client sent invalid data or malformed request. Status code 404 "Not Found" means the requested resource does not exist on the server.
Click to reveal answer
beginner
Why use status code 500 in your Node.js server responses?
Status code 500 "Internal Server Error" signals that something went wrong on the server side, like an unexpected error or exception.
Click to reveal answer
beginner
What status code should you use to indicate unauthorized access?
Use status code 401 "Unauthorized" when the client needs to authenticate or provide valid credentials to access the resource.
Click to reveal answer
Which status code indicates a successful GET request?
✗ Incorrect
200 means the request was successful and the server returned the data.
What status code should you return after successfully creating a new user?
✗ Incorrect
201 means a new resource was created successfully.
If a client sends a request with missing required fields, which status code fits best?
✗ Incorrect
400 means the request was bad or malformed.
Which status code means the requested page or resource was not found?
✗ Incorrect
404 means the resource does not exist on the server.
What status code should be used when the server encounters an unexpected error?
✗ Incorrect
500 indicates an internal server error.
Explain when and why you would use HTTP status codes 200, 201, 400, 401, 404, and 500 in a Node.js API.
Think about common client-server interactions and errors.
You got /6 concepts.
Describe how proper use of status codes improves communication between a client and a Node.js server.
Consider how a client reacts to different server responses.
You got /4 concepts.