When you’re working with web applications, whether as a website administrator or a penetration tester, chances are you’ve had to do a web search on a three-digit code like “
how to fix 404 error” and wade through the same volume of search results repeatedly. You’ve seen the three-digit code before, but it always slips your mind.
These three-digit codes are called HTTP status codes. They’re crucial to understanding server behavior, conducting appropriate security tests, or refraining from overdoing them. Servers flooded with requests usually return 4XX or 5XX errors, which you will find below, and having too many redirects can also point to serious cyber space security problems.
From now on, you don’t have to do those searches anymore because we have prepared this HTTP status codes cheat sheet for you. You can download this cheat sheet here.
When you’re ready, let’s dive in.
What Is an HTTP Status Code?
HTTP is short for “Hypertext Transfer Protocol”. An HTTP status code consists of three digits. It tells you the result of a client request to a server and the semantics of the server response, including whether the request was successful and its contents if such a payload exists. All valid status codes are between 100 and 599 inclusive.
HTTP status codes come in five classes, each of which has the same theme. In the graphic below, “you” refers to the client, and “I” to the server:
The Top 5 Most Commonly Used Status Codes
The RFC 9110 specification consists of 63 standard status codes, beyond which are custom HTTP status codes defined by server administrators. Here are the top five status codes you need to know:
- 200 OK: Ideally, you want this because it means you’ve found your desired website or the data on a submitted web form has reached its destination intact.
- 301 Moved Permanently / 308 Permanent Redirect: Websites often shorten their addresses for easy visitor access, such as omitting “www.” A shortened link redirects users to a web resource at its original, longer Uniform Resource Identifier (URI).
- 404 Not Found: The server is up, but the resource is missing, thanks to deletion or a modified URI, as is often the case for website updates.
- 403 Forbidden: The server denies the client access to a resource. We have a penchant for challenging this status code: Opening the frame source of some embedded videos in a new tab gives me this error, as the videos have a strict same-origin policy. Yet sometimes, we could download those videos from alternate source URLs found through the browser’s Inspector.
- 501 Internal Server Error / 503 Service Unavailable: The server is not functioning and can’t respond to any requests you make to it. Visitors of the website are at the mercy of administrators.
Informational Requests: 1XX
When a server returns a 1XX code, it means the server has received and understood your request, and your browser only needs to wait for the server to finish processing your data.
|100||Continue||The server has received the request headers, and the client should proceed to send the request body.|
|101||Switching Protocols||The requester has asked the server to change protocols using a protocol upgrade mechanism, and the server has agreed.|
|102||Processing||The server has accepted the entire request but is still processing it.|
|103||Early Hints||Use it with the Link header to preload resources while the server prepares a response.|
Success Requests: 2XX
2XX requests mean your transmitted data has reached the server or the resource you want from the server has arrived safely at your machine.
|200||OK||The request succeeded.|
|201||Created||The server acknowledged a newly created resource.|
|202||Accepted||The server has received the client’s request but is still processing it.|
|203||Non-Authoritative Information||The server’s response to the client differs from the initial response that the server sent.|
|204||No Content||The server has processed the request but isn’t returning any content.|
|205||Reset Content||The client should refresh the document sample.|
|206||Partial Content||The server is sending only part of the resource.|
|207||Multi-Status||The server response may contain multiple response codes.|
|208||Already Reported||The server response highlights duplicate internal contents with this status code.|
|226||IM Used||IM stands for “instance manipulation” in HTTP Delta Coding. The server has fulfilled a GET request, and the server response involves IMs.|
Redirection Requests: 3XX
When you encounter a 3XX status code, the server will redirect you to a web location different from your initial URI.
|300||Multiple Choices||The client must choose among several possible responses for the server request.|
|301||Moved Permanently||The server tells the client the requested resource is now at another URI permanently.|
|302||Found||The server tells the client that the requested resource is temporarily at another URI.|
|303||See Other||The server doesn’t redirect the client to the requested resource but to another page.|
|304||Not Modified||The server response is the same as in the past, so the client can continue to use the client’s cached version of the server response.|
|305||Use Proxy (deprecated)||The client could only access the requested resource through a proxy given in the response. Deprecation was because in-band configuration of a proxy is insecure.|
|306||(unused/reserved)||A previous version of the HTTP/1.1 specification used this response code.|
|307||Temporary Redirect||The server tells the client that the resource they are looking for is temporarily at another URI.|
Unlike 302, the client must access the new URI using the same HTTP method as the original URI.
|308||Permanent Redirect||The server tells the client that the resource they are looking for is now at another URI permanently.|
Unlike 301, the client must access the new URI using the same HTTP method as the original URI.
Client Errors: 4XX
These are client errors, such as a missing page, incorrect data format, unauthorized access, or a mistake in the request.
|400||Bad Request||The client has sent a request with incomplete, ill-constructed, or invalid data.|
|401||Unauthorized||The client lacks the authorization needed to access the requested resource.|
|402||Payment Required||A rare status code reserved for digital payment systems.|
|403||Forbidden||The server prohibits the client from accessing the resource.|
|404||Not Found||This code denotes a nonexistent resource on a working server.|
|405||Method Not Allowed||The server has received and recognized the request but has rejected the specific request method.|
|406||Not Acceptable||The website or web application doesn’t support the client’s request with a particular protocol.|
|407||Proxy Authentication Required||Similar to 401 Unauthorized, but the server requires authorization via a proxy.|
|408||Request Timeout||The request the client sent to the server has expired.|
|409||Conflict||The request transmitted conflicts with the server’s internal operations.|
|410||Gone||The resource sought by the client is permanently unavailable.|
|411||Length Required||The server requires the |
|412||Precondition Failed||The server does not meet the conditions indicated by the client.|
|413||Payload Too Large||Request entity exceeds server limits.|
|414||URI Too Long||The URI requested by the client is longer than the server is willing to interpret.|
|415||Unsupported Media Type||The server doesn’t support the media format of the requested data and thus rejects the request.|
|416||Requested Range Not Satisfiable||The server response cannot fulfill the range specified by the |
|417||Expectation Failed||The server cannot meet the expectation indicated by the |
|418||I’m a teapot||The server sends this response to undesirable requests, such as automated queries.|
|421||Misdirected Request||The request went to a server unable to produce a response.|
|422||Unprocessable Entity||Semantic errors in the request prevented the server from sending the expected response.|
|423||Locked||The requested resource is locked.|
|424||Failed Dependency||The failure of a previous request doomed this request to failure.|
|425||Too Early||The server aborted a request that might be part of an (intentional or unintentional) replay attack.|
|426||Upgrade Required||The server would only perform the request after the client upgrades to one or more different protocols specified in its |
|428||Precondition Required||The origin server requires the request to satisfy certain conditions.|
|429||Too Many Requests||The client has sent too many requests in a given amount of time.|
|431||Request Header Fields Too Large||The server is unwilling to process the request because of oversized header fields.|
|451||Unavailable for Legal Reasons||The server cannot legally provide the requested resource, such as a government-censored page.|
Server Errors: 5XX
These are server errors. The client has made a valid request, but the server cannot provide the requested resource.
|500||Internal Server Error||The server has run into problems while processing the client’s request.|
|501||Not Implemented||The server can’t resolve the client’s HTTP request method.|
|502||Bad Gateway||The server, acting as a gateway or proxy, received an invalid message from an inbound server.|
|503||Service Unavailable||The server appears non-functional and can’t process the client’s request.|
|504||Gateway Timeout||The server, acting as a gateway, fails to produce a response in time.|
|505||HTTP Version Not Supported||The server doesn’t support the HTTP version used in the request.|
|506||Variant Also Negotiates||The server has an internal configuration error that leads to content conflicts.|
|507||Insufficient Storage||The server doesn’t have enough storage to perform the HTTP method of the request.|
|508||Loop Detected||The server detected an infinite loop while processing the request.|
|510||Not Extended||The server requires further extensions to the request before fulfilling it.|
|511||Network Authentication Required||The client needs to get authenticated on the network to access the resource.|
Codes for Web Application Security Testing
Here are the most relevant HTTP status codes for security testing of web apps:
|405||Method Not Allowed|
|500||Internal Server Error|
This HTTP status codes cheat sheet covers all HTTP codes. We hope this HTTP error codes cheat sheet helps you troubleshoot web applications and improve their security. Once familiar with these HTTP status codes, explore the Web Hacking courses included in our VIP Membership to consolidate your learning. Have fun.