Kbase 18829: HTTP 1.1 Status Codes and Their Meaning
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/21/2003 |
|
Status: Technically Reviewed
GOAL:
HTTP 1.1 Status Codes and Their Meaning
FIX:
What are HTTP status codes?
These are not part of WebSpeed, but they help in the debugging of WebSpeed issues. This Solution is RESTRICTED because I'm not sure whether the information contained herein is subject to copyright or not.
Whenever a request is sent from a browser to a web server, to get a web page, it is actually sending a HTTP request to the web server. This HTTP request contains information such as the version of HTTP, the file being requested, security information, and cookies.
The web server, upon receiving this request, tries to make some sort of response to the request. This response is made up of some more HTTP headers, usually along with the requested information. One of the HTTP headers that is returned as the response is the status code. This status code indicates how
the web server handled the particular request. The informationthat is output by the browser is based in part on the HTTP status code that is returned.
The following is an excerpt from the HTTP 1.1 RFC2068, which further discusses status codes:
RFC 2068 HTTP/1.1 January 1997
6.1.1 Status Code and Reason Phrase
The Status-Code element is a 3-digit integer result code of the attempt to understand and satisfy the request. These codes are fully defined in section 10. The Reason-Phrase is intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason - Phrase.
The first digit of the Status-Code defines the class of response. The last two digits do not have any categorization role. There are 5 values for the first digit:
o 1xx: Informational - Request received, continuing process
o 2xx: Success - The action was successfully received, understood,
and accepted
o 3xx: Redirection - Further action must be taken in order to
complete the request
o 4xx: Client Error - The request contains bad syntax or cannot be
fulfilled
o 5xx: Server Error - The server failed to fulfill an apparently
valid request
The individual values of the numeric status codes defined for HTTP/1.1, and an example set of corresponding Reason-Phrase's, are presented below. The reason phrases listed here are only recommended -- they may be replaced by local equivalents without affecting the protocol.
Status-Code = "100" ; Continue
| "101" ; Switching Protocols
| "200" ; OK
| "201" ; Created
| "202" ; Accepted
| "203" ; Non-Authoritative Information
| "204" ; No Content
| "205" ; Reset Content
| "206" ; Partial Content
| "300" ; Multiple Choices
| "301" ; Moved Permanently
| "302" ; Moved Temporarily
| "303" ; See Other
| "304" ; Not Modified
| "305" ; Use Proxy
| "400" ; Bad Request
| "401" ; Unauthorized
| "402" ; Payment Required
| "403" ; Forbidden
| "404" ; Not Found
| "405" ; Method Not Allowed
| "406" ; Not Acceptable
| "407" ; Proxy Authentication Required
| "408" ; Request Time-out
| "409" ; Conflict
| "410" ; Gone
| "411" ; Length Required
.| "412" ; Precondition Failed
| "413" ; Request Entity Too Large
| "414" ; Request-URI Too Large
| "415" ; Unsupported Media Type
| "500" ; Internal Server Error
| "501" ; Not Implemented
| "502" ; Bad Gateway
| "503" ; Service Unavailable
| "504" ; Gateway Time-out
| "505" ; HTTP Version not supported
How do HTTP status codes affect WebSpeed?
In most applications, WebSpeed is independent of the HTTP status codes. When debugging WebSpeed issues, however, it can be useful to look at the HTTP response codes.
As an example, when debugging issues with the Java Section Editor in WebSpeed Workshop 2.1, the HTTP status code might be 401. This indicates that the request has failed authentication (this was a bug in WebSpeed 2.1 - refer to Solution 17319, "WebSpeed 2.x Java Workshop Problems -- Editor and Wizards").
Another example: when trying to run a WebSpeed URL, you might get a message on the browser "501 Not Implemented". This means that the web server itself does not know how to process the request. You would typically get this if you were trying to use the WSNSA (Netscape) messenger with the IIS (Microsoft) web server.
Alternatively, an old version of IIS might not support the ISAPI messenger.
Where do I find what HTTP status codes were sent?
If you were interested in seeing the HTTP status codes, most web servers have a facility to log incoming requests and their responses. In IIS, this file is \Winnt\system32\LogFiles\inYYMMDD.log, giving a separate log file for each day. Other web servers should document where their log files are.
Progress ProtoSpeed also provides a mechanism for watching the HTTP headers in requests and responses..