RFC 2616 - Hypertext Transfer
Protocol -- HTTP/1.1
HTTP Response Codes
An HTTP server takes a request from a client and generates a response.
Responses, like requests, consist of a response line, headers, and a body. The
response line contains the HTTP version of the server, a response code, and a
reason phrase. The reason phrase is some text that describes the response, and
could be anything, although a recommended set of reason phrases is given in the
specification. Response codes themselves are three-digit numbers that are
divided into groups. Each group has a meaning as shown here:
1xx: Informational: Request received, continuing process.
2xx: Success: The action was successfully received, understood, and accepted.
3xx: Redirection: Further action must be taken in order to complete the request.
4xx: User-Agent Error: The request contains bad syntax or cannot be fulfilled.
5xx: Server Error: The server failed to fulfill an apparently valid request.
Each Status: Code has an associated string (reason phrase).
The status code you'll see most often is 200. This means that everything has
succeeded and you have a valid response. The others you are likely to see are:
401: you are not authorized to make this request
404: cannot find the requested URI
405: the HTTP method you have tried to execute is not supported by this URL
(e.g., you have sent a POST and the URL will only accept GET)
500: Internal Server Error. You are likely to see this if the resource to where
you are browsing (such as a Servlet) throws an exception.
If you send a request to a Servlet and get a 500 code, then the chances are your
Servlet has itself thrown an exception. To discover the root cause of this
exception, you should check the application output logs. Tomcat's logs are
stored in /logs13 directory of the Tomcat installation.