June 2014
Intermediate to advanced
696 pages
38h 52m
English
You need to set the HTTP status for a response if it is something other than 200. It is important to send the correct status response so that the browser or other applications can handle the HTTP response correctly. To set the status response, use the status(number) method, where the number parameter is the HTTP response status defined in the HTTP spec.
For example, the following lines set different statuses:
res.status(200); // OKres.status(300); // Redirectionres.status(400); // Bad Requestres.status(401); // Unauthorizedres.status(403); // Forbiddenres.status(500); // Server Error
Read now
Unlock full access