Sending the correct HTTP status code

The HTTP specification dictates that any response must have a three-digit status code that allows programs to determine the nature of the response. These codes allow a program to process the response efficiently:

Status code Class of response Description
1xx Informational The request was received but not yet fully processed. The client doesn't need to do anything.
2xx Success The request was successfully received, understood, and accepted.
3xx Redirection The resource has moved, either temporarily or permanently. The client needs to take further actions to complete the request.
4xx Client error The request is syntactically and/or semantically incorrect, and the server was unable (or refused) ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.