Content |
Interpretation of codes of errors of the answer of the HTTP server
Formats of the answer of the server
The server responds with attempt of data transmission in a certain sequence and a format to each request of the user. For example, the HTTP answer (Response) has the following format:
Status line Answer headings Headings of data (can be absent - depends on request type). Blank line Data (can be absent - depends on request type).
The status line has an appearance: the protocol/version----the code----the status The status - the text line commenting on the code is intended for the person; the software analyzes only a numerical code value. Examples of status lines: HTTP/1.1,200 OK or HTTP/1.1,304 Not Modified
The response code is three-digit number. Codes are separated on groups depending on the first digit:
- 1HH - Information. The request is accepted, process continues. Intermediate information messages (it is practically not used).
- 2HH - Success. The message was successfully accepted.
- 3HH - Redirection. It is necessary to make a number of actions for end of a request. For obtaining the document additional actions from client side are required.
- 4HH - Client's error. The request contains a syntax error and cannot be satisfied.
- 5HH - Server error. The server cannot execute an external correct request[1].
All response codes of the HTTP server are given below.
Errors 1HH
- 100 Continuation
- 101 Switching of protocols
Errors 2HH
- 200 Regulation - OK - the Request is satisfied. The most general answer: the request is processed, the requested document is transferred to the client (or only its headings - in case of a request of HEAD).
- 201 It is accepted
- 202 It is created
- 203 Not authoritative information
- 204 Does not contain
- 205 Reset contents
- 206 Partially contains - Partial Content - is transferred to the client a part of the document according to the heading "Range:" which was available in a request.
Errors 3HH
- 300 Multiple selection
- 301 It is moved constantly - Moved Permanently - the requested document is moved and new permanent URL is appropriated to it. New the URI document returns in the heading "Location:". As data the short comment with reference to new arrangement of the document returns. In the subsequent requests of this document the client should use new URI. As a rule browsers automatically generate a new request with the specified URI when obtaining code 301. The server is configured for return of answers with code 301 when restructuring its space of documents - the clients using old references were redirected to new arrangement of documents, but did not receive error 404 Not Found.
- 302 It is moved temporarily - Moved Temporarily - the Required document temporarily is on new URL. New the URI document returns in the heading "Location:". As data the short comment with reference to new arrangement of the document returns. In the subsequent requests of this document the client should use old URI.
- 303 Watch another
- 304 It is not changed - Not Modified - the document was requested using a conditional GET request and the condition is not satisfied (for example, the document was not modified since the moment specified in a request in the heading "If-Modified-Since:"). Only the status line and headings of the answer return, headings of data (document) and the document do not return.
- 305 Use the intermediary
Errors 4HH
- 400 The incorrect request - Bad Request - the Request contains a syntax error and cannot be accepted by the server
- 401 It is unknown - Unauthorized - the Request requires user authentication, but the heading "Authorization:" either is absent, or contains unacceptable authentication data. The answer heading "WWW-Authenticate:" in this case should contain information necessary in order that the client defined what is required authentication. In more detail about the procedure of authentication of access to the closed resources see below the item. "Processing of a request of the client".
- 402 Payment is necessary
- 403 Forbidden - Forbidden Pages - Access to these pages is closed. The server understood a request, but intentionally refused to execute it. Authentication in this case will not help. The cause of failure can be transferred in quality of data of the HTTP answer. If the server does not wish to open a cause of failure, it can use code 404 instead of code 403.
- 404 It is not found - Not Found - the Server did not find anything that could correspond to URI of a request. The server does not specify whether this situation is permanent or temporary. It is the most general answer in case of impossibility to transfer to the client the requested document; at the same time no assumptions of that become, constantly or temporarily the resource is unavailable and also about the reason of its unavailability. Delete everything that stands behind the last virgule from URL. If the author did not turn on the index.html page, you will see the list of pages.
- 405 The method cannot be resolved - Method Not Allowed - in a request was used the method which is not permitted by the server (for example, DELETE). The list of the permitted methods should be placed in the HTTP answer heading "Allow:".
- 406 It is not available - Not Acceptable - in the headings "Accept"... the client specified document perezentation parameters which cannot be executed by the server for this document (for example, there is no such character encoding what is specified in "Accept-Charset:").
- 407 Identification of a proxy, firewall - Proxy Authentication Required is required - the Proxy server (firewall) requires authorization. This error can arise if the proxy server is faulty.
- 408 Request timeout
- 409 Conflict
- 410 It is sent - Gone - similarly 404 "Not Found", however are meant that the document existed earlier, but is intentionally deleted forever (it is made unavailable). It is useful for the temporary presentations, any more relevant, for personal pages of the employees who were any more not working in the organization, etc.
- 411 Length is necessary
- 412 Preliminary error
- 413 The body of a request is too big
- 414 URI requests are too big
- 415 Unsupported type of media types
- 416 It is not applicable
Errors 5HH
- 500 An internal error of the server - Internal Server Error - the Server collided contingencies which do not allow it to execute a request. A typical case - an error in a CGI script.
- 501 It is not executed - Not Implemented - the Server has no potential necessary for implementation of a request. For example, the method specified in a request is not known to the server.
- 502 An error of the internetwork gateway - Bad Gateway - the Server received the incorrect answer from the gateway which it addressed, trying to execute a request. The server operating as the proxy server received the wrong (inadequate) answer from the server to which it redirected the client's request.
- 503 The service is not available - Service Unavailable - the server is temporarily not able to process a request (it is overloaded or is on maintenance [maintanance]). If time through which the server will return to operating condition is known, it can be specified in the heading "Retry-After:". Let's notice that in case of impossibility of service of requests the server is not obliged to issue the answer with code 503, and can just refuse TCP connection establishment. Try once again, in about thirty seconds.
- 504 The timeout of the internetwork gateway - Gateway Timeout - the server operating as the proxy server did not receive for some determined time the answer from the server to which it redirected the client's request. The same code should return the proxy server if there was a timeout at DNS server poll, however some existing proxy servers return at the same time code 400 or 500. The headings transferred after a status line are divided into actually headings of the answer and to headings of the data transferred in the answer (if such headings are required). Each heading begins with a new line and consists of a key word which the colon, and data follows. The sequence of headings does not matter.
- 505 The version of HTTP is not supported