Home | All Questions | alt.html FAQ >

What are the HTTP Status Codes?

"This class of status code indicates that the client's request was successfully received, understood, and accepted."

The status line should contain a status code and a reason phrase. The reason phrase is intended for digestion by humans. The general category of 2XX status codes convey a generally successful transfer.

The specific reason phrase can be altered without affecting the protocol. But the example given in the RFC is "OK".

By the HTTP protocol (RFC 2616, available in hypertext format at http://www.w3.org/Protocols/rfc2616/rfc2616.html ), the meaning of 200 is "The request has succeeded". It is the generic normal response given when a client has requested for a page and the server is sending it. The meanings of HTTP codes are not defined by people who write or run servers; rather, those people should comply with the meanings specified in the protocol. Protocols, or agreements, or whatever you call them are crucial for interoperability.

The reason why [it is thought] that 200 means "modified/new page" might be that when a user visits a URL, it often happens that the client (browser) gets a copy of the page from its own cache, or from a proxy cache, without bothering the server. If it is a completely new page (there never was anything under the given URL before), then obviously this can't happen. But generally, a client may well send a request and the server may well respond with 200 even if the page is old and unmodified, just because there is no "sufficiently fresh" copy available.

The code 499 has no fixed meaning in the protocol. It can be used for various purposes as long as it is understood that there is no universal meaning for it, except in the sense that it falls into category "other 4xx codes", i.e. codes beginning with 4 and not equal to any of the defined codes. By the protocol,

" The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included entity to the user. "

HTTP Protocol Error Codes:

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-URL Too Large
415 Unsupported Media Type
500 Server Error
501 Not Implemented
502 Bad Gateway
503 Out of Resources
504 Gateway Time-Out
505 HTTP Version not supported

Recommended Resources


Related Questions