Every handler must return a status code. There are many possible codes, each of which is associated with a symbolic constant. The constants are defined by the Apache::Constants module if you are using Perl and the
httpd.h include file if you are using the C language.
The URI was found. Its contents follow.
The URI was created in response to a PUT.
The request was accepted for processing at a later date.
This is nonauthoritative mirrored information.
The request was successful, but there's no content to display.
A portion of the document follows.
3XX Codes--Multiple Choices Available
There are multiple document choices. (Used in content negotiation.)
The document has permanently moved to a new URI.
The document has temporarily moved to a new URI.
The document has not been modified since it was cached.
4XX Codes--Client-Side Errors
The request contains a syntax error.
The client did not provide correct authorization information.
Payment is required. (Used in charging schemes.)
The client is not allowed to access the document.
The requested document does not exist.
The request method (e.g., PUT) is not allowed here.
The request is not acceptable.
Proxy server must provide authentication.
The client waited too long to complete the request.
The requested document has been permanently removed.
A conditional retrieval of the document has failed.
The client tried to PUT or POST data that was too long.
The client tried to fetch a URI that was too long.
The client tried to PUT or POST data using an unsupported MIME type.
5XX Codes--Server-Side Errors
The server encountered an unexpected error condition.
An HTTP feature is unimplemented.
An error occurred in a remote server during a proxy request.
The server is temporarily down.
A remote server timed out during a proxy request.
The server doesn't support this version of HTTP.
A negotiated document has several alternative representations.
The Perl examples throughout this book use the nicknames when available, even though their formal equivalents can be imported using the
Apache::Constants :http tag. We do this partly because of historical reasons and because the :common tag imports a small number of functions--only those we need for the majority of modules. As always with Perl, there's more than one way to do it; the choice is yours.
In addition to the HTTP status codes, Apache defines some return codes of its own which handlers use to send status information to the server.