Softpanorama
May the source be with you, but remember the KISS principle ;-)

Contents Bulletin Latest Last year Top visited Scriptorama

Return codes for proxy and HTTP server requests

The return codes indicate the status of requests made on the user behalf when the user tries to access a URL. The codes that are most useful during the log analysis are:

  • 200 -- OK (file was delivered to the user)
  • 304 -- cached (the proxy has a file in the cache)
  • 403  -- forbidden. File was blocked either by Smartfilter (on our side) or by web server on the target side.
  • 404  -- "file not found"
  • All-in all several dozen HTTP server return codes have been defined and each uniquely describes a different condition. The codes are divided into four categories. Each category reserves a range of 100 possible values and defines a broad class of possible conditions:

  • 100-199 (informational codes). Pretty rare class of codes. They basically provide information about the request or the servers involved.
  • 200-299 ("success" codes). Though 200 is the most common of these, several others exist. For example 204 is used to indicate that the requested file is empty (no content), 202 that some request from the user was accepted.
  • 300-399 (redirects). This ranges includes code 304, which indicates that the file requested has been cached and does not need to be downloaded again.
  • 400-499 (client errors). A client (browser) may, for example, request a page from the server that doesn't exist. The ultimate cause of such an error may be a mistyped link, but the errors still referred to as a client error. Other 400 level errors include code 403 ("forbidden").
  • 500-599 (server errors). These errors indicate that there is an internal server error or a configuration problem that is preventing the server from properly responding to the request. This type of error is most often encountered in Web sites that are considerably more complex than static HTML. Problems retrieving information from a database or interpreting Java code might be behind server errors.
  • Here's a fairly complete list that you might want to print for future reference.

    200 Series:

  • 200 - OK - Successful transmission. This is not an error code, this is acually a success code. The file you requested was found, here it is.  The length of file transmitted is recoded in the next field. 
  • 201 - Created - The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URL(s) returned in the URL-header field of the response, with the most specific URL for the resource given by a Location header field.
  • 202 - Accepted - The request has been accepted for processing, but the processing has not yet completed.
  • 203 - Non-Authoritative Information - The returned META information in the Entity-Header is not the definitive set as available from the origin server, but is gathered from a local or third-party copy.
  • 204 - No Content - The server has fulfilled the request, but there is no new information to send back.
  • 206 - Partial Content - you requested a range of bytes in the file, and here they are. This is new in HTTP/1.1
  • 300 Series:

  • 300 - Multiple Choices - The requested source 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 URL and any future references to this resource should be done using one of the returned URLs.
  • 302 - Moved Temporarily - The requested resource resides temporarily under a new URL. Redirection to a new URL. The original page has moved. This is not an error; most browsers invisibly fetch the new page upon seeing this result.
  • 303 - See Other - The requested resource resides under a different URL 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 to the client. Use local copy. This means that the copy of the file on the web server is not newer than the copy which your web browser or proxy server has cached locally, so there's no point in sending the file again. This is not an error. The file hasn't changed since the last time you asked for it, so I'm not going to send it again.
  • 400 Series:

  • 400 - Bad Request - The request could not be understood by the server due to it having a malformed syntax. Bad request was made by the client.
  • 401 - Unauthorized - The request requires user authentication. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested source. The user asked for a document but did not provide a valid username or password.
  • 402 - Payment Required - This code is not currently supported, but is reserved for future use.
  • 403 - Forbidden - The server understood the request but is refusing to perform the request because of an unspecified reason. Access is explicitly denied to this document. (This might happen because the web server doesn't have read permission for the file you're requesting.) The server refuses to send you this file. Maybe permission has been explicitly turned off.
  • 404 - Not Found - The server has not found anything matching the requested URL. This file doesn't exist. That error often can come from a mistyped URL or from URL that is no longer valid (for example the site seized to exist). Sometimes this code is sent if the server has been told to protect the document by telling unauthorized people that it doesn't exist.
  • 405 - Method Not Allowed - The method specified in the request line is not allowed for the resource identified by the request URL.
  • 406 - None Acceptable - The server has found a resource matching the request URL, but not one that satisfies the conditions identified by the Accept and Accept-Encoding request headers.
  • 407 - Proxy Authentication Required - This code is reserved for future use. It is similar to 401 (Unauthorized) but indicates that the client must first authenticate itself with a 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 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.
  • 412 - Precondition Failed
  • 413 - Request Entity Too Large
  • 414 - Request URI Too Large
  • 415 - Unsupported Media Type
  • 500 Series:

  • 500 - Internal Server Error - The server encountered an unexpected condition that prevented it from filling the request. Something went wrong with the web server and it couldn't give you a meaningful response. There is usually nothing that can be done from the browser end to fix this error; the server administrator will probably need to check the server's error log to see what happened. This is often the error message for a CGI script which has not been properly coded.
  • 501 - Method Not Implemented - The server does not support the functionality required to fulfill the request. Application method (either GET or POST) is not implemented.
  • 502 - Bad Gateway - The server received an invalid response from the gateway or upstream server it accessed in attempting to fulfill the request.
  • 503 - Service Temporarily Unavailable - The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. Server is out of resources.
  • 504 - Gateway Timeout - The server did not receive a timely response from the gateway or upstream server it accessed in attempting to complete the request.
  • 505 - HTTP Version Not Supported
  • 8181 - Certificate has expired (secure server only).



    Copyright © 1996-2012 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine. This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

    Disclaimer:

    Last modified: September 13, 2011