HTTP response codes

  • Revision slug: HTTP/HTTP_response_codes
  • Revision title: HTTP response codes
  • Revision id: 26989
  • Created:
  • Creator: avsaro
  • Is current revision? No
  • Comment 19 words added

Revision Content

HTTP Response Codes indicate whether a specific HTTP requests has been successfully completed. Responses are grouped in five classes: informational responses, successful responses, redirections, client errors, and servers errors.

The following table lists them all, with their respective meanings:

Error code Error text Description HTTP version
Informational responses
100 Continue This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished. HTTP/1.1 only
101 Switching Protocol This code is sent in response to an Update: request header by the client, and indicates that the protocol the server is switching too. It was introduced to allow migration to incompatible protocol version, and is not in common use. HTTP/1.1 only
Successful responses
200

OK

The request has succeeded. The meaning of a success varies depending on the HTTP method:
  • GET: The resource has been fetched and is transmitted in the message body.
  • HEAD: The entity headers are in the message body.
  • POST: The resource describing the result of the action is transmitted in the message body.
  • TRACE: The message body contains the request message as received by the server.
The methods PUT, DELETE, and OPTIONS can never result in a 200 OK response.
HTTP/0.9 and later
201 Created The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request. HTTP/0.9 and later
202 Accepted The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing. HTTP/0.9 and later
203 Non-Authoritative Information This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response. HTTP/0.9 and 1.1
204 No Content There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones. HTTP/0.9 and later
205 Reset Content This response code is sent after accomplishing request to tell user agent reset document view which sent this request. HTTP/1.1 only
206 Partial Content This response code is used because of range header sent by the client to separate download into multiple streams. HTTP/1.1 only
Redirection messages
300 Multiple Choice The request has more than one possible responses. User-agent or user should choice one of them. There is no standardized way to choice one of the responses. HTTP/1.0 and later
301 Moved Permanently This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response. HTTP/0.9 and later
302 Found This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests. HTTP/0.9 and later
303 See Other Server sent this response to directing client to get requested resource to another URI with an GET request. HTTP/0.9 and 1.1
304 Not Modified This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response. HTTP/0.9 and later
305 Use Proxy This means requested response must be accessed by a proxy. This response code is not largely supported because security reasons. HTTP/1.1 only
306 unused This response code is no longer used, it is just reserved currently. It was used in a previous version of the HTTP 1.1 specification. HTTP/1.1 only
307 Temporary Redirect Server sent this response to directing client to get requested resource to another URI with same method that used prior request. HTTP/1.1 only
Client error responses
400 Bad Request This response means that server could not understand the request due to invalid syntax. HTTP/0.9 and later
401 Unauthorized Authentication is needed to get requested response. This is similar to 403, but in this case, authentication is possible. HTTP/0.9 and later
402 Payment Required This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently. HTTP/0.9 and 1.1
403 Forbidden Client does not have access rights to the content so server is rejecting to give proper response. HTTP/0.9 and later
404 Not Found Server can not find requested resource. This response code probably is most famous one due to its frequency to occur in web. HTTP/0.9 and later
405 Method Not Allowed The request method is known by the server but has been disabled and cannot be used. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code. HTTP/1.1 only
406 Not Acceptable This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent. HTTP/1.1 only
407 Proxy Authentication Required This is similar to 401 but authentication is needed to be done by a proxy. HTTP/1.1 only
408 Request Timeout This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome or IE9, use HTTP preconnection mechanisms to speed up surfing (see {{ bug("634278") }}, which tracks the future implementation of such a mechanism in Firefox). Also note that some servers merely shut down the connection without sending this message. HTTP/1.1 only
409 Conflict This response would be sent when a request conflict with current state of server. HTTP/1.1 only
410 Gone This response would be sent when requested content has been deleted from server. HTTP/1.1 only
411 Length Required Server rejects responding due to the fact that Content-Length header field is not defined. HTTP/1.1 only
412 Precondition Failed This response code means that one or more of the preconditions defined by the client in header fields is not met by server. HTTP/1.1 only
413 Request Entity Too Large Request entity is larger than limits defined by server. Server might close the connection or return an Retry- After header field. HTTP/1.1 only
414 Request-URI Too Long URI requested by client is too long to handle for server. HTTP/1.1 only
415 Unsupported Media Type Media format of request entity is not supported by server therefore server rejects fulfill the request. HTTP/1.1 only
416 Requested Range Not Satisfiable This response code means Range request-header field provided in request cannot be met by server. HTTP/1.1 only
417 Expectation Failed This response code means Expect request-header field provided in request cannot be met by server. HTTP/1.1 only
Server error responses
500 Internal Server Error The server meets an unhandled situation. Therefore it cannot give requested response. HTTP/0.9 and later
501 Not Implemented The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD. HTTP/0.9 and later
502 Bad Gateway This error response means that the server while working as a gateway to get response needed to handle the request get an invalid response. HTTP/0.9 and later
503 Service Unavailable The server is not ready to handle your request. Common cause are a server down for maintenance or overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contains the estimated time before the recovery of the service. Webmaster must also take care about the caching-related headers they send along with this response as these temporary condition responses should usually not be cached. HTTP/0.9 and later
504 Gateway Timeout This error response is given when the server work as a gateway and cannot get response in time. HTTP/1.1 only
505 HTTP Version Not Supported   HTTP/1.1 only
506 Variant Also Negotiates   RFC 2295

Revision Source

<p>HTTP Response Codes indicate whether a specific <a href="/en/HTTP" title="en/HTTP">HTTP</a> requests has been successfully completed. Responses are grouped in five classes: informational responses, successful responses, redirections, client errors, and servers errors.</p>
<p>The following table lists them all, with their respective meanings:</p>
<table class="standard-table" style="width: 100%;"> <thead> <tr> <th scope="col">Error code</th> <th scope="col">Error text</th> <th scope="col">Description</th> <th scope="col">HTTP version</th> </tr> </thead> <tbody> <tr> <th colspan="4"><em>Informational responses</em></th> </tr> <tr> <td id="100">100</td> <td>Continue</td> <td>This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="101">101</td> <td>Switching Protocol</td> <td>This code is sent in response to an <code>Update:</code> request header by the client, and indicates that the protocol the server is switching too. It was introduced to allow migration to incompatible protocol version, and is not in common use.</td> <td>HTTP/1.1 only</td> </tr> <tr> <th colspan="4"><em>Successful responses</em></th> </tr> <tr> <td id="200">200</td> <td> <p>OK</p> </td> <td>The request has succeeded. The meaning of a success varies depending on the HTTP method: <ul> <li>GET: The resource has been fetched and is transmitted in the message body.</li> <li>HEAD: The entity headers are in the message body.</li> <li>POST: The resource describing the result of the action is transmitted in the message body.</li> <li>TRACE: The message body contains the request message as received by the server.</li> </ul> The methods PUT, DELETE, and OPTIONS can never result in a 200 OK response.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="201">201</td> <td>Created</td> <td>The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="202">202</td> <td>Accepted</td> <td>The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="203">203</td> <td>Non-Authoritative Information</td> <td>This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.</td> <td>HTTP/0.9 and 1.1</td> </tr> <tr> <td id="204">204</td> <td>No Content</td> <td>There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="205">205</td> <td>Reset Content</td> <td>This response code is sent after accomplishing request to tell user agent reset document view which sent this request.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="206">206</td> <td>Partial Content</td> <td>This response code is used because of range header sent by the client to separate download into multiple streams.</td> <td>HTTP/1.1 only</td> </tr> <tr> <th colspan="4"><em>Redirection messages</em></th> </tr> <tr> <td id="300">300</td> <td>Multiple Choice</td> <td>The request has more than one possible responses. User-agent or user should choice one of them. There is no standardized way to choice one of the responses.</td> <td>HTTP/1.0 and later</td> </tr> <tr> <td id="301">301</td> <td>Moved Permanently</td> <td>This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="302">302</td> <td>Found</td> <td>This response code means that URI of requested resource has been changed <em>temporarily</em>. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="303">303</td> <td>See Other</td> <td>Server sent this response to directing client to get requested resource to another URI with an GET request.</td> <td>HTTP/0.9 and 1.1</td> </tr> <tr> <td id="304">304</td> <td>Not Modified</td> <td>This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="305">305</td> <td>Use Proxy</td> <td>This means requested response must be accessed by a proxy. This response code is not largely supported because security reasons.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="306">306</td> <td><em>unused</em></td> <td>This response code is no longer used, it is just reserved currently. It was used in a previous version of the HTTP 1.1 specification.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="307">307</td> <td>Temporary Redirect</td> <td>Server sent this response to directing client to get requested resource to another URI with same method that used prior request.</td> <td>HTTP/1.1 only</td> </tr> <tr> <th colspan="4"><em>Client error responses</em></th> </tr> <tr> <td id="400">400</td> <td>Bad Request</td> <td>This response means that server could not understand the request due to invalid syntax.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="401">401</td> <td>Unauthorized</td> <td>Authentication is needed to get requested response. This is similar to 403, but in this case, authentication is possible.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="402">402</td> <td>Payment Required</td> <td>This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.</td> <td>HTTP/0.9 and 1.1</td> </tr> <tr> <td id="403">403</td> <td>Forbidden</td> <td>Client does not have access rights to the content so server is rejecting to give proper response.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="404">404</td> <td>Not Found</td> <td>Server can not find requested resource. This response code probably is most famous one due to its frequency to occur in web.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="405">405</td> <td>Method Not Allowed</td> <td>The request method is known by the server but has been disabled and cannot be used. The two mandatory methods, <code>GET</code> and <code>HEAD</code>, must never be disabled and should not return this error code.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="406">406</td> <td>Not Acceptable</td> <td>This response is sent when the web server, after performing <a href="/en/HTTP/Content_negotiation#Server-driven_negotiation" title="https://developer.mozilla.org/en/HTTP/Content_negotiation#Server-driven_negotiation">server-driven content negotiation</a>, doesn't find any content following the criteria given by the user agent.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="407">407</td> <td>Proxy Authentication Required</td> <td>This is similar to 401 but authentication is needed to be done by a proxy.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="408">408</td> <td>Request Timeout</td> <td>This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome or IE9, use <a class="external" href="http://www.belshe.com/2011/02/10/the-era-of-browser-preconnect/" title="http://www.belshe.com/2011/02/10/the-era-of-browser-preconnect/">HTTP preconnection mechanisms</a> to speed up surfing (see {{ bug("634278") }}, which tracks the future implementation of such a mechanism in Firefox). Also note that some servers merely shut down the connection without sending this message.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="409">409</td> <td>Conflict</td> <td>This response would be sent when a request conflict with current state of server.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="410">410</td> <td>Gone</td> <td>This response would be sent when requested content has been deleted from server.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="411">411</td> <td>Length Required</td> <td>Server rejects responding due to the fact that Content-Length header field is not defined.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="412">412</td> <td>Precondition Failed</td> <td>This response code means that one or more of the preconditions defined by the client in header fields is not met by server.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="413">413</td> <td>Request Entity Too Large</td> <td>Request entity is larger than limits defined by server. Server might close the connection or return an Retry- After header field.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="414">414</td> <td>Request-URI Too Long</td> <td>URI requested by client is too long to handle for server.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="415">415</td> <td>Unsupported Media Type</td> <td>Media format of request entity is not supported by server therefore server rejects fulfill the request.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="416">416</td> <td>Requested Range Not Satisfiable</td> <td>This response code means Range request-header field provided in request cannot be met by server.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="417">417</td> <td>Expectation Failed</td> <td>This response code means Expect request-header field provided in request cannot be met by server.</td> <td>HTTP/1.1 only</td> </tr> <tr> <th colspan="4"><em>Server error responses</em></th> </tr> <tr> <td id="500">500</td> <td>Internal Server Error</td> <td>The server meets an unhandled situation. Therefore it cannot give requested response.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="501">501</td> <td>Not Implemented</td> <td>The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="502">502</td> <td>Bad Gateway</td> <td>This error response means that the server while working as a gateway to get response needed to handle the request get an invalid response.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="503">503</td> <td>Service Unavailable</td> <td>The server is not ready to handle your request. Common cause are a server down for maintenance or overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the <code>Retry-After:</code> HTTP header should, if possible, contains the estimated time before the recovery of the service. Webmaster must also take care about the caching-related headers they send along with this response as these temporary condition responses should usually not be cached.</td> <td>HTTP/0.9 and later</td> </tr> <tr> <td id="504">504</td> <td>Gateway Timeout</td> <td>This error response is given when the server work as a gateway and cannot get response in time.</td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="505">505</td> <td>HTTP Version Not Supported</td> <td> </td> <td>HTTP/1.1 only</td> </tr> <tr> <td id="505">506</td> <td>Variant Also Negotiates</td> <td> </td> <td><a class="external" href="http://tools.ietf.org/html/rfc2295#section-8.1" title="http://tools.ietf.org/html/rfc2295#section-8.1">RFC 2295</a></td> </tr> </tbody>
</table>
Revert to this revision