HTTP response codes are given to the browser whenever the browser completes a task. These messages can beanything from a resource loading correctly, or your contact form failing to submit. The browser normallydoes not show these responces unless they are errors, although you can find a log of them if you wish.However, if an error occurs, you can easily find it in the console, and possibly display on-screen. You canlearn how to set custom error pages here.
Did you know that the first number of an HTTP response will tell you what category the message is in? Ifyou didn’t, you do now! There are five different categories, beginning with the number one, two, three,four, and five respectively. Makes sense right?
Responses beginning with one are informative responses. If it begins with the number two, it’s asuccessful response. Beginning with a three means that it is a redirect. If it begins with a four, thatmeans there was a client error. Lastly, a response beginning with a five means there was a server error.Confused? Check out the table below.
Begins with | Message | Range |
---|---|---|
Begins with a one (1) | Informative | 100-199 Response codes |
Begins with a two (2) | Success | 200-299 Response codes |
Begins with a three (3) | Redirect | 300-399 Response codes |
Begins with a four (4) | Client Error | 400-499 Response codes |
Begins with a five (5) | Server Error | 500-599 Response codes |
Informative Responses (100-199)
Code | Meaning | Description |
---|---|---|
100 | Continue | A response meaning that everything is working properly, and the client computer should continuerequesting information, unless all requests have been completed |
101 | Switching Protocols | Indicating that the protocol is switching, and providing the new protocol to connect with |
102 | Processing | Indicating that the server has received and is processing the request, but no other information isavailable yet |
103 | Early Hints | Used to return various response headers before main content load. Not compatible with most browsers. |
Advertisement
Successful Responses (200-299)
Code | Meaning | Description |
---|---|---|
200 | OK | The request has succeeded |
201 | Created | Typically sent after POST requests, this response means that the request has succeeded, and as aresult, a new resource has been created |
202 | Accepted | The server has received the request, but has not begun processing it. Typically used when multipleservers are used to accept and progress requests |
203 | Non-Authoritative Information | Returned meta-information is not the same from the origin server, and is collected locally or froma third party. Unless those requirements are met, a “200 - OK” code is used instead |
204 | No Content | No content is available to send for the request. The user-agent device may update cache-headersfor this resource |
205 | Reset Content | Informing the user-agent device to reset the document that sent the request |
206 | Partial Content | An XML message that by default contains a number of separate response codes depending on the number of sub-requests were made |
207 | Multi Status | Used when the Range header sent from the client requests only part of the resource |
208 | Already Reported | Members of a DAV binding have already been received in an earlier part of the multistatus response, and are not being included again |
226 | IM Used | The server has completed a resource request, and the response is a representation of the result of one or more instance-manipulations applied to the current instance |
Redirection Responses (300-399)
Code | Meaning | Description |
---|---|---|
300 | Multiple Choices | Used when the request has multiple possible responses. The user-agent is then responsible forselecting a response |
301 | Moved Permanently | The requested URL has been permanently moved. Directs the user-agent to update the cache toreflect changes |
302 | Found | The requested URI has been temporarily moved. Future changes may be made, and cache should not beupdated |
303 | See Other | This response is used when the server requests the client to get a requested resource elsewherewith a GIT parameter |
304 | Not Modified | Used for caching purposes. This response tells the client that the response has not been changed,so the client can continue its use of the cached version |
307 | Temporary Redirect | A response used to direct the client to a different resource at a different URI using the samemethod |
308 | Permanent Redirect | The resource has been permanently moved. Similar to “301 - Moved Permanently”, except theuser-agent cannot change the request method |
Advertisement
Client Error Responses (400-499)
Code | Meaning | Description |
---|---|---|
400 | Bad Request | Learn More - The server could not understand therequest |
401 | Unauthorized | Learn More - Technically “Aunauthorcated“. Meaningthat the client needs to authenticate to gain access |
402 | Payment Required | Reserved for future use. The idea was to use it for online payment, but the code is rarely used,and in some instances, not implemented |
403 | Forbidden | Learn More - The client does not have the rightsto access this content. Learn how to customize theerror page |
404 | Not Found | Learn More - The most common 400 error code. Perit’s name, the response means that the requested resource cannot be found. Learn how to customize this error page |
405 | Method Not Allowed | The methods used in the request are supported on the server, but are not supported by the resource |
406 | Not Acceptable | Sent when the server doesn’t find any matching content after performing server-driven contentnegotiation |
407 | Proxy Authorization Required | Similar to “401 - Unauthorized” except authorization must be completed by a proxy |
408 | Request Timeout | Learn More - Used when the server wished to closethe connection. Sometimes sent on idle server connections. Some servers do not send the message, butabruptly shut down instead |
409 | Conflict | A response sent when a request conflicts with the server |
410 | Gone | Response returned when requested content has been removed from the server, without a forwardingaddress listed. The user agent should purge any cache on the resource |
411 | Length Required | Used when the “Content Length” header is not defined, but the server requires it |
412 | Precondition Failed | Client has conditions defined in the headers that the server does not meet |
413 | Payload Too Large | Request is larger than server defined limits. The server may close the connection or send a 409responce |
414 | URI Too Long | Used when the server is not willing to interpret a client’s long URI |
415 | Unsupported Media Type | Request rejected by the server, as the requested media format of requested data is not supportedby the server |
416 | Range Not Satisfiable | Range specified on the header cannot be completed. The range may be outside the size of the targetURI’s data |
417 | Expectation Failed | Response code used to indicate that the “Expect” header field cannot be met by the server |
418 | I'm a teapot | Learn More - Used when the server refuses to brewcoffee with a teapot |
421 | Misdirected Request | Used when the request is sent to a server that cannot produce a response. Can also be sent byservers not configured to send responses |
425 | Too Early | Used when the server is unwilling to process a possible duplicate request |
428 | Precondition Required | The server requires a conditional request that is not met by the user-agent |
429 | Too Many Requests | Learn More - The client has sent too manyrequests in a given timeframe, and has been temporarily blocked by the server |
431 | Request Header Fields Too Large | The server refuses to process the request because the headers are too large. If headers arereduced in size, the request may be accepted by the server |
451 | Unavailable For Legal Reasons | The resource cannot be legally provided by the server per the servers configuration |
Server Error Responses (500 - 599)
Code | Meaning | Description |
---|---|---|
500 | Internal Server Error | Learn More - The server encountered an unknownerror. |
501 | Not Implemented | The server does not support the request method used. Only GET and HEAD methods are required forservers to support |
502 | Bad Gateway | This response means that the server, while trying to get a response from a different server orgateway, encountered an error |
503 | Service Unavailable | Learn More - This response means that the serveris not ready to handle requests. The server may be down for maintenance, or it may be overloaded |
504 | Gateway Timeout | Similar to “502 Bad Gateway”, except the server is unable to set a request in the timeframeprovided |
505 | HTTP Version Not Supported | The HTTP version used in the request is not supported by the server |
506 | Variant Also Negotiates | An internal error has occurred pertaining to the negotiation of resources |
508 | Loop Detected | The server detected an endless loop during processing and aborted the request |
510 | Not Extended | Additional extensions are required for the server to process the request |
511 | Network Authorization Required | This response means that the client must authenticate to gain acess to the server network |
That's it! Check out the Response Codes FAQ to learn more about the mostpopular error codes. If we messed up (After all, we are humans), please let usknow!
Advertisement
Article Author
Related Articles
The HTTP 418 error is given when the server refuses to brew coffee, mainly because it calls itself a teapot Otherwise known as the Hypertext Coffeepot Protocol, this error code originated from <a hre...
Advertisement
All code and content © 2023. Contact Us to learn more.