The server's response to a client request is grouped into three parts. The first line is the server response line, which contains the HTTP version number, a three-digit number indicating the status of the request (called a server response code or status code), and a short phrase describing the status. The response line is followed by the header information and an entity body if there is one.
Status codes are typically generated by web servers. However, they can also be generated by CGI scripts that bypass the server's precooked headers and supply their own. Status codes are grouped as follows.
Code range |
Response meaning |
---|---|
100-199 |
Informational |
200-299 |
Client request successful |
300-399 |
Client request redirected, further action necessary |
400-499 |
Client request incomplete |
500-599 |
Server errors |
HTTP defines only a few specific codes in each range, although servers may define their own as needed. If a client receives a code it does not recognize, it should understand its basic meaning from its numerical range. While most web browsers handle codes in the 100-, 200-, and 300-range silently, some error codes in the 400- and 500-range are commonly reported back to the user (e.g., "404 Not Found").
A response in the range of 100-199 is informational, indicating that the client's request was received and is being processed.
A response in the range of 200-299 means that the client's request was successful.
A response code in the 300-399 range indicates that the request was not performed, and the client needs to take further action for a successful request.
A response code in the range of 400-499 means that the client's request was incomplete and may indicate further information is required from the client.
Response codes in the range of 500-599 indicate that the server encountered an error and may be unable to perform the client's request.
Copyright © 2003 O'Reilly & Associates. All rights reserved.