View on GitHub

reading-notes

Status Codes Based On REST Methods

img

  1. In your own words, describe what each group of status code represents: 1.100’s = its a status which tells the client information about the header of the code may be his request will not be successful before sending a data. 2.200’s = it tells the client his request is successul 3.300’s = it tells that the resource isnt available now anymore 4.400’s = it tells that there is an error but related to the request from the clint 5.500’s = it tells there is an error in the server

2.What is a status code 202? it means that the request met all validation requirements at the time of sending.

3.What is a status code 308? This tells the client to use another URL to access the resource and not use the current URL anymore. It’s helpful when we have multiple endpoints for one resource, but don’t want to implement reading from all of them.

4.What code would you use if an update didn’t return data to a client? 204 No Content

5.What code would you use if a resource used to exist but no longer does? 307 Temporary Redirect

6.What is the ‘Forbidden’ status code? The client has authorized or doesn’t need to authorize itself, but still has no permissions to access the resource.

Build A REST API With Node.js, Express, & MongoDB - Quick - First 20 minutes

  1. Why do we need to pull our MongoDB database string out of our server and put it into our .env?

3.What does app.use(express.json()) do?

4.What does the /:id mean in a route?

5.What is the difference beween PUT and PATCH?

6.How do you make a defalut value in a schema?

7.What does a 500 error status code mean?

8.What is the difference between a status 200 and a status 201?