HTTP Response Codes

Table of Contents

  1. 2xx - Success
  2. 3xx - Redirection
  3. 4xx - Client error
  4. 5xx - Server error
  5. For More Information

  1. 2xx - Success

    200-series HTTP response codes indicate that the request was processed without any error conditions. The 200-series responses other than 200 are seldom seen in practice.

    • 200 OK
    • 201 Created
      Following a POST command, this indicates success, but the text of the response line indicates the URL of the new document.
    • 202 Accepted
      Request accepted for asynchronous processing.
    • 203 Partial Information
      Returned information may be cached or private.
    • 204 No Response
      Used for scripts that don't return a visible result.

    Table of Contents | HWG-Servers FAQ

  2. 3xx - Redirection

    300-series response codes indicate that the document requested has moved to some other location, or that the browser is being redirected for some other reason.

    • 301 Moved
      Browsers with link editing capabilities should automatically link to the new reference. The response contains one or more header lines of the form URI: url string CrLf which specify alternative addresses for the object in question. The string is an optional comment field.
    • 302 Found
      Same as move, except that linking to the found address doesn't make much sense, since the document URL is expected to change. This is the code that the httpd returns for a cgi script whose output contained a Location: header.
    • 303 Method
      Same as found, but a different method may be used to access the document; details about the method are sent in the message body.
    • 304 Not modified
      Use the local copy if you cached it. Often seen when using the HEAD method, rather than the GET method.

    Table of Contents | HWG-Servers FAQ

  3. 4xx - Client error

    400-series messages indicate that the browser did something wrong.

    • 400 Bad Request
      Impossible request or syntax error
    • 401 Unauthorized
      Request should be retried with proper authorization header. This is the response which triggers the browser to pop up the dialog requesting your username and password.
    • 402 Payment Required
      Request should be retried with proper charge-to header.
    • 403 Forbidden
      Authorization will not help
    • 404 Not found
      A document with that URL doesn't exist.
  4. 5xx - Server error

    500-series messages indicate that something went wrong on the server. Usually associated with CGI problems.

    • 500 Internal Error
      A rather meaningless catch-all message that indicates that the site admin goofed on their CGI program.
    • 501 Not implemented
      Another rather ambiguous message, typically meaning that you tried to execute something that was not executable, or POST to someting that was not a CGI program, or something similar.
    • 502 Timed out
      Not in the HTTP spec, but implemented by some HTTP servers.

    Table of Contents | HWG-Servers FAQ

  5. For More Information
    • HTTP specifications at the W3C
    • Webmaster in a Nutshell (O'Reilly and assoc.)
      A nice handy desktop reference with this information in it, with additional explanation.

    Table of Contents | HWG-Servers FAQ

[Valid HTML 4.0!]
This page is maintained by Rich Bowen. Last updated on 22 December 1999.
Copyright © 1998 by the HTML Writers Guild, Inc.