What Are HTTP Status Codes? (WIth Types and What They Mean)

By Indeed Editorial Team

Published May 29, 2022

The Indeed Editorial Team comprises a diverse and talented team of writers, researchers and subject matter experts equipped with Indeed's data and insights to deliver useful tips to help guide your career journey.

Putting a request through your browser communicates with a remote server containing your request information. The status code gives a progress report on this request in real-time. Learning about Hypertext Transfer Protocol (HTTP) status codes helps you understand why your search requests fail and how better to structure them. In this article, we explore what HTTP status codes are and identify common types of status codes while discussing their meanings.

What are HTTP status codes?

HTTP status codes help track the exchange of information between servers and browsers. For example, when you send a request for data through your browser, these status codes indicate whether the request is successful or not. They also include important information for your requests, such as your browser, time, and location.

Related: Web Developer Skills: Definitions and Examples

Types of HTTP status codes

The meaning of an HTTP status code depends on the first of the three digits. These digits, which may be 1, 2, 3, 4, or 5, mean any of the following:

1 is an informational response

It's an informational response, which means that the server is still processing your request. Examples include:

100 - Continue

It's an interim response meaning that the initial part of the request is complete and successful, and the server is processing the rest. It also means that there's no error as everything is functioning properly. The client may continue the request by sending the remaining part or ignore it if the request is already complete. If the request is complete, the server may send a final response.

101 - Switching protocol

Here, the server understands the request, is processing it, and may change the application protocols used in the connection based on the upgrade message header field information. This upgrade header field comes after the empty line that terminates the 101 response. The server switches the protocol only when it's advantageous to the client. For instance, it may switch from an older HTTP version to a newer one or a real-time synchronous protocol.

102 - Processing

This means that the server has received the request and is still processing it. It also means no error with the search request or the server. Still, there's no response because of the slow network or server. In some cases, a timeout can occur where the processing isn't successful.

2 signifies success

It means that the server received and processed the request with no errors. Examples include:

200 - OK

This code means the request was successful as the server received the information. It may also display the requested data, if any. The request may also return data indicated in the status code. This data depends on the method you used in the request message and the way the end server receives it.

201 - Created

Here, the server has fulfilled the request and has created a new resource referenced in the return URI in the response entity. The server creates this resource before returning to the 201 status code. As a result, the server may not act immediately, responding with a 202 response. The response entity containing the URI also contains the most specific URI. It also contains a list of resource characteristics and locations to choose the most appropriate. The format in which this response comes depends on the media type in the content-type header field.

202 - Accepted

The server has accepted the request but is yet to process it. This response doesn't guarantee that the request becomes successful after processing, as it may become disallowed. The response entity to this request indicates the current status of the request or can be a pointer to a status monitor, so the client knows when to expect the fulfillment of the request.

The purpose of this response is to allow the server to accept another request without insisting that the user agent's connection waits until the process is complete. The other process that the server accepts may be a batch-oriented process run once daily. This response is non-committal as it only acknowledges receipt of the request.

203 - Non-authoritative information

This code means that the returned meta-information or data in the entity header doesn't match what's available on the original server. For example, the server received code 200 from its origin but responded with a modified version. This version may be a superset or subset of the original. This status code may be because the response data arrived through a proxy or a local or third-party copy of the server containing the original data. This response code may return when the only other option is a 200 status code.

Related: Top 15 Careers in Programming (With Salaries and Job Duties)

206 - Partial content

Partial content requires the server to process a GET request for the resource. This request contains a range header field indicating the desired range, including an If-range header field. The range header field may either be a content-range header field, multipart, or byte ranges content-type that includes every part's content range field. It may also include a date, an ETag, or content location.

3 means redirection

It means that the server redirected your request to another website or page, and it's necessary for you to carry out further actions to fulfill the request. Examples include:

300 - Multiple choice

The server sends a code with the reporting entity containing a list of all the potential options to your request for you or your user agent to choose from, except if the user sent a HEAD request. The media type in the content-type header field determines the entity format. Depending on the capabilities and format of the user agent, the server may automatically select the most appropriate option, although it may not specify the standard for this selection. Each option contains specific agent-driven negotiation information and a unique location to redirect its request for requested data.

301 - Moved permanently

This code represents a responding entity that includes a new URL as it assigns the requested resource a new permanent URL because the old one is either broken or no longer exists. The location field in the response contains the new permanent URL. Also, the response entity contains a hyperlink with the new URL and a short hypertext note, except if you used the HEAD request method. The code also informs the user to update the reference to the old URL and re-link new references if link editing is possible.

302 - Found

This code is a temporary redirect that indicates a temporary change in the URI. There may be more changes in the future, so it's advisable to use the new URL containing the requested resource. The temporary URI is in the location field in the request-response. The entity may contain a short hypertext note and hyperlink to the new URI, except a HEAD request.

305 - Use proxy

The code tells the user to send the request again, as the server needs to use a proxy to complete the request. After the user tries again, the second request goes to the proxy server containing the requested resource. The location field provides the URI for the proxy, and origin servers may only generate this response.

Related: How to Become a Software Engineer

4 symbolizes a client error

It means that there's an error either because the person making the request or the page or website requested doesn't exist. Examples include:

400 - Bad

The code implies a syntax error in the user's request, causing the error by preventing the server from receiving the request. It may also mean that the user framed the request wrongly, making it invalid. The user may modify the request and resend it to access the requested data.

401 - Unauthorized

The server requires user authentication as it believes that the user doesn't have the authorization to access the data. The server requires that the user resends the request with a valid authentication header field, which the server may still reject if incorrect. After the rejection, the server may include in the response relevant diagnostic information.

403 - Forbidden

The server refuses to fulfill the request either because the user doesn't have access to the requested data or needs an account to access the data. Authorization isn't a solution to this response, and it's not advisable for the user to repeat the request. The server may disclose the reason behind the rejection if it's not a HEAD request method.

5 signals a server error

It means that although you made a valid request, there was an error with the server. Examples include:

502 - Bad gateway

The data requested exists, and the server understands the request but cannot complete the process. It may be due to an error in getting data from the original server through proxy servers. It may also be because the server acting as a gateway received an invalid response from the accessed upstream server.

504 - Gateway timeout

The server acting as a proxy or gateway experienced a delay from the upstream server indicated in the URI or an auxiliary server. The server waits for a specified period, after which it returns this response. This error is temporary, as you may try again after some time.

505 - HTTP version not supported

The request message contains an HTTP protocol version, which the server doesn't support. This response contains an entity indicating why the server doesn't support the version. It may also contain a list of other protocols that the server supports.

Related: What Is a Client-server Model? (With Functions and Benefits)

Explore more articles