Skip to main content.

Web Based Programming Tutorials

Homepage | Forum - Join the forum to discuss anything related to programming! | Programming Resources

Teach Yourself CGI Programming with Perl 5 in a week Second Edit

Appendix C -- Status Codes and Reason Phrases

Appendix C

Status Codes and Reason Phrases


The following information is a subset of an Internet draft known as Hypertext Transfer Protocol-HTTP/1.0 and is available at

http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-01.html

The status code element is a three-digit integer result code of an attempt to understand and satisfy a request. The reason phrase is intended to give a short, textual description of the status code. The status code is intended for use by the supporting software 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 five values for the first digit, as shown in Table C.1.

Table C.1. Status codes and meanings.

Numeric
English Meaning
1xx
InformationalThis is not used; it is reserved for future use.
2xx
SuccessThe action was received, understood, and accepted.
3xx
RedirectionFurther action must be taken in order to complete the request.
4xx
Client ErrorThe request contains bad syntax or cannot be fulfilled.
5xx
Server ErrorThe server failed to fulfill an apparently valid request.

Table C.2 lists the individual values of the numeric status codes defined for HTTP/1.0.

Table C.2. Status codes for HTTP/1.0.

Code
Reason Field Meaning
201
Created The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URI(s) returned in the URI-header field of the response, with the most specific URI for the resource given by a Location header field.
202
Accepted The request has been accepted for processing, but the processing has not been completed.
203
Non-Authoritative The returned metainformation in the Entity-Information header is not the definitive set as available from the origin server, but is gathered from a local or a third-party copy.
204
No Content The server has fulfilled the request, but there is no new information to send back.
300
Multiple Choices The requested resource is available at one or more locations and a preferred location could not be determined via content negotiation.
301
Moved Permanently The requested resource has been assigned a new, permanent URI; any future references to this resource should be done using one of the returned URIs.
302
Moved Temporarily The requested resource resides temporarily under a different URI.
303
See Other The requested resource resides under a different URI and should be accessed using a Get method on that resource.
304
Not Modified If the client has performed a conditional Get request and access is allowed, but the document has not been modified since the date and time specified in the If-Modified-Since field, the server responds with this status code and does not send an Entity-Body header to the client.
400
Bad Request The request could not be understood by the server because it has a malformed syntax.
401
Unauthorized The request requires user authentication. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
402
Payment Required This code is not currently supported, but it is reserved for future use.
403
Forbidden The server understood the request but is refusing to perform the request because of an unspecified reason.
404
Not Found The server has not found anything matching the request URI.
405
Method Not Allowed The method specified in the request line is not allowed for the resource identified by the request URI.
406
None Acceptable The server has found a resource matching the request URI, but not one that satisfies the conditions identified by the Accept and Accept-Encoding request headers.
407
Proxy
Authentication
(Unauthorized)
Required
This code is reserved for future use. Itis similar to 401, but it indicates that the client first must authenticate itself with the proxy. HTTP/1.0 does not provide a means for proxy authentication.
408
Request Timeout The client did not produce a request within the time that the server was prepared to wait.
409
Conflict The request could not be completed due to a conflict with the current state of the resource.
410
Gone The requested resource is no longer available at the server, and no forwarding address is known.
411
Authorization
Refused
The request credentials provided by the client were rejected by the server or insufficient to grant authorization to access the resource.
500
Internal Server
Error
The server encountered an unexpected condition that prevented it from fulfilling the request.
501
Not Implemented The server does not support the functionality required to fulfill the request.
502
Bad Gateway The server received an invalid response from the gateway or upstream server it accessed when attempting to fulfill the request.
503
Service
Unavailable
The server currently is unable to handle the request due to a temporary overloading or maintenance of the server.
504
Gateway Timeout The server did not receive a timely response from the gateway or upstream server it accessed when attempting to complete the request.