Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


HTTP Status Codes Specification

Table 9.2 lists the meanings of the different HTTP status codes. In general, codes 200–299 indicate a successful transaction, while codes 400–599 indicate an error of some type. Codes 300–399 imply redirection: Either the resource has moved, and the server is returning the URL of the new location to the client or the resource has not changed since it was last requested by the client, in which case the server does not need to resend the document.

Time and Date Format Specification

The HTTP protocol defines a preferred format for specifying times and dates—this format is described here. HTTP must also support two other commonly used formats, also described here. In this context, support means that HTTP servers (or gateway programs) should understand these two alternative time formats. However, all Web applications, including CGI programs, should always provide time information using the preferred syntax.

Preferred Format

The preferred format is specified in RFC 1123. An example is:


Table 9.2 HTTP Status Codes. Codes introduced in HTTP 1.1 are in boldface italics and right aligned.
Successful Transactions
200 The request was completed successfully.
201 The request was a POST (or PUT) method and was completed successfully. 201 indicates that data were sent to the server and that the server created a new resource as a result of the request.
202 The request has been accepted for processing, but the results of this processing are unknown. This would be returned, for example, if the client deposited data for batch processing at a later date.
203 The GET (or HEAD) request was fulfilled, but has returned partial information.
204 The request was fulfilled, but there is no new information to send to the client. The browser should do nothing and should continue to display the document from which the request originated.
Redirection Transactions
300 The requested resource is available from more than one location, but the server could not determine which version to return to the client. The response should contain a list of the locations and their characteristics. The client should then choose the one that is most appropriate. This is not currently supported.
301 The resource requested has been permanently moved to a new URL. If this status is returned, the server should also send the client the URL of the new location via the header
Location: URL comments
where URL is the new document URL. Browsers that understand the Location field will automatically connect to the new URL.
302 The resource was found but it actually resides at a different URL. If this status is returned, the server should also send the client the correct URL via the header
Location: URL comments
Browsers that understand the Location field will automatically connect to the new URL. You will get a 302 Redirection if a URL pointing to a directory is missing the trailing slash character.
303 The response is available at a different URL and should be retrieved using a GET method. This lets a server, accessed via a POST method request, redirect the client to a second resource that should be accessed using the GET method.
Redirection Transactions
304 A GET request was sent that contained the If-Modified-Since field, and the server found that the document had not been modified since the date specified in this field. Consequently, the server responds with this code and does not re-send the document.
305 The request must be accessed through a proxy server; the response must also contain a Location: field specifying the location of the proxy. This is not currently supported.
Client Error Messages
400 The request syntax was wrong.
401 The request required an Authorization: field, and the client did not specify one. The server also returns a list of the allowed authorization schemes using a WWW-Authenticate response header. This mechanism is used by a client and server to negotiate data encryption and user authentication schemes.
402 The requested operation costs money and the client did not specify a way to pay. There is no specification for payment methods, so this is not currently implemented.
403 The client has requested a resource that is forbidden. No explanation is provided for this refusal.
404 The server cannot find the requested URL.
405 The client tried to access a resource using a method that is not allowed for that resource. The response must include a list of allowed methods, contained within an Allow: field. This is not widely implemented.
406 The resource was found, but could not be delivered because the type of the resource is incompatible with the acceptable types indicated by the accept: or accept-encoding: headers sent to the server by the client.
407 The request was to a proxy server, and the proxy server requires authentication information; the proxy server must also return a Proxy-authenticate header field to indicate the authentication scheme required by the server. This is not currently supported.
408 The client did not produce a request in a timely manner, and the server has timed out and is breaking the connection. This is not currently supported.
409 The request could not be completed due to a conflict; for example, a PUT is not allowed because someone else has locked the resource. This is not currently supported.
Client Error Messages
410 The resource is no longer available at the server and no forwarding information is available.
411 The server is refusing access because the client tried to access the server and send data to the server, but did not use a content-length header to give the size of the data stream. This is not currently supported.
412 The server is refusing access because one of the conditions in the request header field was not satisfied. This is not currently supported.
413 The server is refusing access because the request is too large in some way. The server should include a Retry-after response header field to indicate when the client should try again. This is not currently supported.
414 The server is refusing access because the URI of the request is too long. This is not currently supported.
415 The server is refusing access because the client is trying to send data in a MIME type not supported by the server. This is not currently supported.
Server Error Messages
500 The server has encountered an internal error and cannot continue with the request.
501 The request made is legal, but the server does not support this method.
502 The client requested a resource from a server that, in turn, attempted to access the resource from another server or gateway. In this case, the secondary server or gateway did not return a valid response to the server.
503 The service is unavailable, because the server is too busy. The server may also send a Retry-After: header, which tells the client how long to wait before trying again.
504 The client requested a resource from a server that, in turn, attempted to access the resource from another server or gateway. This is similar to 502, except that in this case, the transaction failed because the secondary server or gateway took too long to respond.
505 The server does not support the HTTP protocol version in which the request was posed. This is not currently supported.
Wed, 09 Aug 1995 07:49:37 GMT


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.