Status Codes Based On REST Methods
100’s = information 200’s = success codes 300’s = redirections 400’s = client errors 500’s = server errors
the request has been accepted for processing, but the processing has not been completed yet
indicates that the requested resource has been permanently moved to a new URI, and future references should use that new URI with the same method
204 No Content
410 Gone
The ‘Forbidden’ status code is 403. It indicates that the server understood the request, but is refusing to fulfill it. This status code is typically used when the client does not have the necessary permissions to access the requested resource.
Build A REST API With Node.js, Express, & MongoDB - Quick - First 20 minutes
it contains sensitive information (password)
something that gets executed before it passes information to express
tells the server to expect JSON formatted data rather than POST info
it means that there’s a parameter that we can access with req.params.id
PUT updates all the information, PATCH only updates that which was changed
add a default tag. E.g. if you want the current datetime on creation you could add
default: Date.now()
and if you didn’t include a date, it’d default to the current datetime.
it means that there’s an error on our server
200: OK 201: Successfully created an object