In your own words, describe what each group of status code represents:
Code 202 is a validation message for asynchronous processes. It simply means that validation requirements were met.
Permanent redirect. It points the client to another URL to access the resource. Similarly, 307 does the same but is temporary in nature.
In this case, assuming no errors, it would be code 204. An example of use would be saving a document.
This would be code 410. This means the resource existed but was deleted or moved.
The forbidden status code is 403. This code means no authorizations are needed, but access is still denied.
This is due to security issues. Otherwise a DOS attack is possible, or many other forms of attacks.
Middleware is the code that acts upon the resources between the database and the front-end server.
This line of code allows for middleware to be used and applies JSON formatting.
The “:id” is a parameter. This can be access via req.params.id
.
PUT is a complete update while PATCH is a partial update.
To set a default, use default:
to set the parameter. Then, the default value can be entered thereafter.
This means the database had some kind of error. This is serparate from the user and client.
Code 201 is used for CREATE. In the header response will be the location URL of the newly created resource.
Why would anyone feel the need to customize the error codes and extend them? Are 206 codes used for packet downloads?