Code

HTTP Errors: Code Definitions and a Complete List of Statuses

HTTP Errors: Code Definitions and a Complete List of Statuses

Training program with a guarantee of employment: «Web Development»

Learn More

If you've ever seen a 404 error in a web browser, then you already have some understanding of HTTP codes. These codes are used to clarify how the server handled the request and what obstacles encountered when trying to open the site or load information.

There are many codes that describe different situations, such as server errors, the need to pay for a subscription to access a resource, restrictions imposed by parental controls, and many others.

In this article, we will look at the most common HTTP codes and explain their meanings.

Contents

  • What are HTTP codes
  • HTTP status codes that belong to the 1xx category are informational messages. These codes notify the client that its request has been accepted and is being processed, but is not yet complete. For example, code 100 indicates that the server is ready to continue processing the request, while code 101 signals that the server has accepted the client's proposed protocol change. These messages help establish more efficient communication between the client and server by providing advance information about the request's progress.
  • HTTP success codes, which fall under the 2xx category, indicate that the client's request was processed correctly and without errors. These codes confirm the successful completion of operations initiated by the user, and can include values ​​such as 200 (OK), 201 (Created), 204 (No Content), and others, each of which has its own characteristics and purpose depending on the context of the request and the action performed by the server.
  • Redirects are HTTP codes belonging to the 3xx group.
  • Errors that occur due to the client are classified under the HTTP 4xx codes.
  • Errors that occur on the server are designated by HTTP 5xx codes.

What are HTTP Codes

HTTP status codes are three-digit numeric responses that a server sends in response to a client request, such as from a web browser. These codes provide information about how the server handled the request: whether it was successful or an error occurred.

HTTP codes are an important tool for developers to diagnose server performance. They provide insight into how requests are being processed and where problems may arise. Users encounter these codes in the form of error messages such as "404 - Page Not Found" or "500 - Internal Server Error." These codes are used to quickly determine the nature of the problem and begin the process of resolving it.

Error code 404 on GitHubScreenshot: GitHub / Skillbox Media

HTTP codes have a direct impact on actions Search engine robots. For example, when a page returns a 404 status code, it signals to search engines that the page is missing and they exclude it from indexing.

Let's look at the key HTTP status codes and their interpretation, as outlined in documents such as RFC 9110, RFC 4918, RFC 6585, and RFC 2324.

HTTP 1xx Status Codes: Temporary Notifications

These codes indicate that the request has been accepted and the server is continuing to work on it. Users typically do not see these codes in their browsers.

Continue.

The server has processed the initial part of the request and is now ready to receive the main content. This code is used in cases where the client first transmits headers and then, after receiving confirmation from the server, sends the main content, such as a large file. This avoids unnecessary data transfer.

101 Switching Protocols: Protocol Change

The server confirms its agreement to switch to a new protocol, which is specified in the Upgrade header. This code is used, in particular, when changing the protocol from HTTP to WebSocket: when the client initiates a protocol change request, the server responds with status 101, after which the communication continues using the new protocol.

102 Processing: Process in progress

The server successfully receives and processes the request, but the operation takes some time to complete. This code is intended to avoid a timeout on the client side in situations where actions take a long time, such as downloading a large file.

103 Early Hints: Provisional Response

The server may send information to the browser before the full response is received. Most often, these are preliminary headers containing data about the resources that the browser needs to download, such as CSS styles, JavaScript scripts, or fonts. Then, after the download is complete, the server forwards the main response.

105 Could not resolve name: Name resolution error.

This error message indicates that the server was unable to resolve the domain name because the DNS query did not provide an IP address. Possible causes for this situation include typos in the address bar, incorrect DNS server settings, or lack of internet access.

HTTP 2xx Request Success Codes

Codes in the 2xx range indicate that the request from the client was successfully accepted, processed, and fulfilled.

200 OK: Success

The server informs that the request was successfully processed and all required data was transferred. This code is used, for example, when loading web pages or retrieving information via an API.

201 Created: created

The request was successfully processed, and as a result, the server created a new object. For example, when a user registers on a website, the server simultaneously creates an account for them.

202 Accepted: the request was successfully processed.

The request is being processed, but is not yet complete. The result of processing will be available later. This code is used for performing long-running operations, such as working with large files.

203 Unauthoritative: this information does not have authoritative status.

The server provides data that was obtained from an external source, but includes a disclaimer that this information may be incomplete or subject to change. For example, the proxy server passed the information, but modified it slightly by excluding unnecessary headers.

204 No Content: No content.

The request was successfully completed by the server, but the response has no body, only headers. This code is used in situations where there is no need to receive data in the response, for example, when deleting items via an API or updating the status without returning content.

205 Reset Content: Clear the content.

The request was successfully processed, and the server is asking the client to remove the content, which could include, for example, clearing a form. This code is used in the context of REST APIs or web applications, where it is necessary to return the interface to its initial state. For example, when you submit information through a form, the server may prompt the browser to reset it after a successful submission.

206 Partial Content: This is a state in which the server successfully processes the request, but returns only part of the expected data. This situation can arise, for example, when downloading large files or streaming information, when the client receives chunks of data as it is processed. Thus, a response with code 206 indicates that the requested resource was successfully found, but was transferred incompletely.

The server provided part of the information requested by the client. This code is intended for incremental data downloads. For example, when a user downloads a large file and, after stopping, resumes the download from a specific point.

207 Multi-Status is a response that contains multiple statuses.

The server can send multiple responses with different statuses for different components of the same request. This code is used in the WebDAV protocol, which is used in file management systems such as cloud storage.

HTTP Responses with 3xx Codes: Redirection Mechanism

Codes starting with 3xx indicate that the client needs to take additional steps to successfully complete the request, most often following the specified URL. This message from the server informs that the requested resource is no longer available at the original address or has temporarily moved, and the client should follow the suggested route.

300 multiple-choice questions.

Several resource types can respond to such a request, and the server does not automatically select one—the client makes the decision. For example, when a user visits a site that allows language selection, the server will present a list of available options.

301 Moved Permanently.

Moving the requested resource to a new permanent URI will cause the browser to update its bookmarks and begin using the new address for subsequent requests.

302 Found: Found

The resource can currently be found at a different URI. The server redirects the client's request, but does not indicate that the move is permanent, so it is recommended to continue using the original address.

This code is widely used in situations where it is necessary to temporarily redirect the user to another page. This can happen, for example, during advertising campaigns, A/B testing, or when working with forms.

303 See Other: accessing alternative resources.

The server informs that the result of the request can be found at a different URI and suggests the client perform a GET request to the specified address. Code 303 is often used for a secure redirect after using the POST method.

The code is often used for redirection after a form has been submitted: the user has filled in the required fields, but the final data will be available at a different address.

304 Unchanged: the content remains unchanged.

The server informs the client that the requested resource has remained unchanged since the last request. Instead of resending the data, the server only provides headers and the 304 status code, which signals that the cached version can be used.

For example, when a user visits a site, the server finds that images and CSS styles from a previous visit are cached. As a result, instead of downloading them again, the server sends the message: "Not modified."

305 Proxy Usage: Use proxy servers

This system message indicates that a proxy server should be used to access the specified resource. This code is considered obsolete and insecure, and most modern web browsers no longer support it.

306 Unused: Reserved

The 306 code was intended in early versions of the HTTP specification for future use. This code was originally intended to be used to indicate a proxy change.

307 Temporary Redirect: This indicates that the requested resource is temporarily available at a different address.

This status code is similar to 302, but has one significant difference: when a redirect occurs, the HTTP method, such as POST or GET, remains the same. This code is used for temporary URI modifications.

Imagine a situation where you have a website and some of its pages are temporarily unavailable. In this case, you could use the 307 code to redirect visitors to a page where they will see a message about the maintenance being performed.

308 Permanent Redirect: The direction of the request is unchanged.

Status code 308 indicates that the requested resource has permanently moved to a new URI, and all future requests should be made to this new address. Unlike the 301 code, a redirect preserves both the HTTP method and the request content, similar to the 307 code.

HTTP 4xx Codes: Errors Occurring Due to Client Fault

Codes in the 4xx range indicate that an error occurred due to client action. This can occur, for example, due to a malformed request, lack of necessary access rights, or non-compliance with API logic requirements.

400 Bad Request: The request was not executed correctly.

The server is unable to fulfill the request due to a syntax error or a non-compliance with protocol rules. This general-purpose code indicates that the request was malformed and cannot be decoded even at the application logic level.

Read also:

Error 400 is one of the most common HTTP status codes. This code indicates that the request sent by the client to the server contains invalid data or is malformed. As a result, the server cannot process it properly and returns an error. Error 400 can occur for various reasons. It is often caused by incorrect URL syntax, invalid query parameters, or inappropriate headers. It can also be caused by the server not understanding the request's content, which can also cause this error. To resolve the 400 error, a user typically needs to take several steps. First, check the URL they are entering for typos or extra characters. Second, it is a good idea to clear your browser's cache and cookies, as outdated data can affect the correctness of the request. If the error persists, try refreshing the page or using a different browser. It is also recommended to check your network settings and, if necessary, contact the site administrator for more information about possible server issues.

401 Unauthorized: Access Denied

Access to the resource is restricted because the user did not enter valid credentials. For example, they visited the site but were not logged into their account. To resolve this issue, simply enter the correct login information.

Read also:

The 401 Unauthorized error occurs when access to the requested resource is restricted, and the server cannot verify the user's identity. This can happen for several reasons. One of the most common errors is missing or incorrect credentials, such as a username and password. The error can also occur if the user does not have the necessary rights to access the resource or if the authentication token has expired.

To resolve this issue, it's worth taking several steps. First, check that the credentials you entered are correct. If they are, ensure that you have the necessary permissions to access the resource. If you use authentication tokens, it's worth checking their validity and updating them if necessary. If the issue persists, you may need to contact your system administrator or technical support to determine if there are any limitations or issues on the server side.

402 Payment Required: Payment is required.

Code 402 is intended for situations where access to the resource is granted only after payment. However, in practice, its use is extremely rare and is considered experimental.

The developers of the HTTP specification originally intended the 402 status code to designate paid content on web resources. However, in most cases, requests for protected paid content are processed using the 401 and 403 codes.

Access Denied: Error 403.

The server accepted the request but refused to fulfill it because access to the requested resource was denied, even if the client was authenticated. Unlike the 401 code, in this case the reason is not the lack of credentials, but that the user does not have sufficient rights to access or the server has set a direct ban.

For example, a similar error can occur if a user tries to access a page intended exclusively for site administrators, or opens material that has regional restrictions.

Read also:

Error 403, meaning "Access Denied," occurs when the server denies access to the requested resource. This can happen for several reasons, such as insufficient user permissions, server configuration, or network-level restrictions.

To troubleshoot this issue, you should first check whether you have the necessary permissions to access the resource. If you are confident in your permissions, it's worth checking your web server settings. You may need to adjust your firewall configuration or allow access to certain folders.

It's also a good idea to check whether antivirus software or a VPN is blocking access to the site. In some cases, the issue may be related to incorrect URLs or outdated links. If the error persists, you should contact the site administrator for more information about the reason for the ban.

404 Not Found: The requested page does not exist.

Error 404 is one of the most widely known. It indicates that the server is unable to locate the requested content. For example, this can happen if the page has moved to a different address or has been deleted altogether.

Read also:

Error 404, which appears on a web page, signals that the sought content cannot be found. This can happen for a variety of reasons, including the user entering an incorrect URL, the page being deleted or moved without updating its links, or even server issues.

There are several steps you can take to resolve this error. First, check the URL you entered for typos. If the link came from another source, you may want to check that source for up-to-date information.

If you own the site, it's important to ensure all internal links point to existing pages. If a page has been deleted, you can set up a redirect to another, current page. It's also a good idea to update sitemaps and monitor link health to minimize the possibility of errors.

405 Method Not Allowed: This method is not supported.

The server is able to recognize the request, but the resource does not allow the specified HTTP method. For example, if a user attempts to make a PUT request to a server that only accepts GET requests, a 405 error will be displayed.

Error 406: Not compliant.

The server is unable to provide data in the format specified in the Accept header. For example, if the client requests information in XML format, but the server can only provide JSON.

407 Proxy Authentication Required: Authentication with the proxy server is required.

The request cannot be fulfilled because the proxy server requires authentication. For example, if the user has not provided login credentials for the corporate proxy, the browser will display a 407 error.

408 Request Expired: Timed Out.

The client's request took too long, resulting in a disconnect on the server side. This can happen, for example, when the client is experiencing internet connection problems, which prevents the request from being fulfilled quickly.

409 Conflict: Disagreement

The server is unable to fulfill the request due to an inconsistency with the current state of the resource. This indicates that the request itself is valid, but it may pose a risk to data integrity—for example, due to concurrent updates or non-compliance with business constraints.

410 Gone: Deleted

The requested item has been deleted from the server and cannot be restored. For example, if administrators completely deleted a page or file, you would see the 410 code when attempting to access that data.

411 Length Required: The length must be specified.

The server refused to process the request due to the absence of a Content-Length header, which is required for the request body to be transmitted correctly. This code notifies the client that an explicit specification of the amount of information to be transmitted is required to continue the operation.

412 Precondition Failed: The precondition was invalid.

The request was rejected by the server because one of the conditions specified in the If-Match, If-None-Match, If-Modified-Since, or If-Unmodified-Since headers was not met. For example, this can occur when a user attempts to make changes to a resource that has already been updated by another client.

413 Request Entity Too Large: The payload size exceeds the allowed limit.

The request was rejected by the server because the size of the transferred body exceeded the maximum limit set on the server or proxy. This situation can occur when sending files, JSON documents, or other types of data via POST, PUT, PATCH, and similar methods that include a request body.

For example, a user attempts to upload a file whose size exceeds the maximum allowed parameters set in the server configuration.

414 Request-URI Too Long: The URL exceeds the allowed length.

The server was unable to process the request because its address was too long and exceeded the set limit. This error typically occurs when attempting to send a GET request with a large number of additional parameters.

415 Unsupported Media Type: The data format is not supported.

The request was rejected by the server because the content type specified in the Content-Type header is unsupported. This means that the server is unable to handle the format of the data that was submitted, even though the structure of the request itself may be valid.

416 The requested range is not available.

The server cannot perform a partial download of the file because the specified byte range exceeds the actual file size. For example, if the user attempts to download data from 500 to 1000 bytes, but the file itself only contains 400 bytes.

417 Expectation Failed: The request could not meet expectations.

The request was rejected by the server because it cannot fulfill the conditions specified in the Expect header. This typically occurs when the client sends the Expect: 100-continue header, but the server does not support this pre-negotiation.

Customers use the Expect header to indicate what action they expect from the server before sending their request. If the server cannot fulfill this requirement, it responds with the 417 status code.

418 I’m a teapot: I’m a teapot.

As a humorous aside, a code was added to the HTTP specification in April 1998 that reads: “I’m a teapot. I cannot make coffee because it is beyond my capabilities.” For example, if a user attempts to send an “absurd” request, the server will respond with the 418 status code.

421 Maldirected Request

The server received the request but is unable to fulfill it because it is addressed to a different host or resource. This error occurs when a client has connected to one host but attempts to make a request to another.

422 Unable to process entity: The instance cannot be processed.

The server accepted and interpreted the request, but is unable to fulfill it due to semantic errors in its content. For example, the request structure may be correct, but the data it contains does not meet the established validation criteria.

423 Locked: Access Denied

The server is able to recognize the incoming request, but rejects it because an operation is currently being performed on the resource or it is locked. Code 423 is used to implement collaborative editing of files and documents.

Error 424 Failed Dependency indicates that the request cannot be completed due to an unfulfilled dependency.

The request was not completed by the server because one of the dependent requests completed with an error. : Code 424 often occurs when attempting to delete a file that is currently being used by another process.

425 Too Early: This is not the time.

The server assumes that requests will arrive in a specific sequence and is unable to process them in the order they were received.

426 Upgrade Required: An upgrade is required.

The server cannot fulfill the request because the protocol version used by the client is not supported. In most cases, this indicates a need to upgrade from HTTP/1.1 to HTTP/2.

428 Precondition Required: A precondition must be present.

The server expects the request to contain at least one precondition, such as the If-Match or If-Unmodified-Since headers. This requirement is intended to avoid potential conflicts that may arise when accessing a resource simultaneously.

429 Request Limit Exceeded: The number of requests sent is too high.

The server refused to process the request because the client exceeded the configured request limit within a specified period. For example, access to the site was blocked after multiple unsuccessful authorization attempts.

444 No Response.

The connection between the server and the client was terminated without any HTTP response being transmitted. This code occurs exclusively in the Nginx web server and is not defined in the official HTTP specification.

450 Blocked by Windows Parental Controls.

This code, used in Microsoft services, indicates that the parental control system is restricting access to a specific resource. It is used exclusively within the Windows ecosystem.

451 Unable to access for legal reasons.

The request was rejected by the server because access to this resource is restricted for legal reasons, such as legal requirements, court decisions, or administrative regulations.

Server Errors: HTTP 5xx Codes

Codes in the 5xx range indicate that the client's request was completed correctly, but the server was unable to process it due to an internal error or temporary availability issues.

Error 500: Internal Server Error.

This code is a general indicator that the server encountered an unexpected internal problem that prevented it from correctly processing the request from the client. Reasons can range from server code failures to database connection difficulties, as well as conflicts in server settings and other factors.

Read also:

Error 500 is an internal server error, which indicates that a problem occurred while processing the request. This error can occur for various reasons, including software glitches, incorrect server settings, or incompatibilities between components.

There are several steps you can take to resolve the 500 error. First, check the server logs for detailed information about what happened. This can help identify the specific cause of the error. If you have access to the file system, ensure that all files and directories have the correct permissions.

Also, pay attention to your configuration files, as incorrect settings can lead to similar errors. If the problem persists, it is recommended to temporarily disable any plugins or extensions that may be conflicting. If the error occurs on your website, you may want to contact your hosting provider for assistance.

Finally, if none of the above methods work, you should consider restoring your system from a backup or reinstalling the application that is causing the error.

501 Not Implemented: Function not implemented.

The server is unable to process this request for technical reasons. This can happen if the requested method is not supported by the server. For example, if the PATCH method is used, and the server only accepts GET and POST.

502 Bad Gateway: Invalid gateway error.

A server acting as a gateway or proxy received an invalid response from a third-party server. This indicates that the request was passed along the chain, but the response was either missing or corrupted.

503 Service Temporarily Unavailable: The service is currently unavailable.

Temporary difficulties processing requests on a server can occur, for example, if it is overloaded. For example, a resource may remain available, but be experiencing an excess of requests or be down for updates. Errors like these are common when trying to access a well-known news site during peak load periods.

Read also:

Error 503 is a status code that indicates that the server is temporarily unavailable to process the request. This can happen for a variety of reasons, including server overload, maintenance, or temporary outages.

If you encounter this error, here are a few steps to help fix it:

1. Refresh the page: Sometimes the problem can be temporary, and simply refreshing the page will resolve the issue.

2. Check the service status: If you have access to server status information, check to see if there is currently any maintenance or issues.

3. Clear your browser cache: Accumulated data can cause conflicts, so it's worth trying clearing your cache and cookies.

4. Try a different browser or device: Sometimes the error can be related to the settings of a specific browser or device.

5. Contact your hosting provider: If you manage the server, it may be worth contacting your hosting provider to determine the cause of the unavailability.

Following these recommendations, you may be able to resolve the 503 error or at least determine its source.

504 Gateway Timeout: No response from the gateway.

The proxy server or gateway did not receive a response from the upstream server. This error may be due to problems connecting to the primary server or to the slow operation of the upstream server itself.

Read also:

Error 504, also known as «Gateway Timeout», occurs when one server, A server acting as a gateway or proxy doesn't receive a timely response from another server it's trying to contact. This can happen for a variety of reasons, including server overload, network issues, or configuration problems.

There are several steps you can take to resolve this error. First, refresh the page, as temporary glitches can resolve themselves. If this doesn't help, it's recommended to check the status of the servers you're connecting to. It's also a good idea to clear your browser's cache and cookies, as accumulated data can sometimes cause problems.

If you own the website, check your server environment settings. Make sure all components, including databases and other services, are working properly and aren't overloaded. In some cases, it may be necessary to optimize the code or increase timeout limits at the server level.

If the error persists, you should contact your hosting provider or support team for more detailed information and assistance in resolving the problem.

505 Error: Unsupported HTTP protocol version.

The server cannot fulfill the request because the HTTP protocol version used by the client is either not supported or disabled on the server side. This error occurs if the client sent the request using HTTP/1.1, and the server is configured to work only with HTTP/2.

506 Variant is also involved in the negotiation process.

The server is stuck in an infinite loop while trying to choose the optimal variant of the resource. For example, this error occurs when the server is unable to establish the correct response format.

507 Insufficient Storage: Available storage exceeded.

The server is unable to fulfill the request due to insufficient available storage space. This problem occurs when the disk is full or when an attempt is made to upload a file that exceeds the allowed size.

508 Loop Detected: Infinite redirect detected.

The server encountered an infinite loop while executing a request. For example, it tries to cope with recursive links, but is unable to complete the loop.

509 Bandwidth Limit Exceeded: The available bandwidth has been exhausted.

The request was rejected by the server because the traffic limit was reached. In this situation, the client will not be able to access the resource until the data package for the current billing period is renewed.

This code is unofficial and is used exclusively among hosting providers working on the cPanel platform. Its use is not observed in other systems.

510 Not Extended: Extension not fulfilled.

The server is unable to process the incoming request because it requires additional HTTP protocol extensions that the client did not specify. This code is required for interaction with systems that use extended mechanisms, such as distributed APIs or custom HTTP extensions.

511 Network Authentication Required.

In order to access a specific resource, the client must complete a network authentication process. For example, this can manifest itself in the authorization form when connecting to Wi-Fi in a cafe.

Learn more exciting programming topics in our Telegram channel. Join us!

Read also:

  • HTTP, or the Hypertext Transfer Protocol, is the foundation for exchanging information on the internet. It provides a structure by which browsers can request and receive data from web servers. This protocol allows users to interact with web pages, downloading text, images, and other media files.

    The main purpose of HTTP is to ensure that information is transferred between the client and server efficiently and correctly. Without it, operations such as browsing websites, submitting forms, or interacting with various online services would be impossible. Thus, HTTP plays a key role in the functioning of the World Wide Web and in the daily lives of Internet users.

  • The Internet is a complex system of interconnected networks that enable the exchange of information around the world. Its history begins in the 1960s, when the first protocols for data transfer were developed. Since then, it has undergone many changes and has become an integral part of everyday life.

    It is important to note that the Internet and the World Wide Web are not the same thing. Although these terms are often used interchangeably, they actually refer to different things. The Internet is a global network that connects millions of computers, devices, and servers, enabling the transfer of data. While the World Wide Web, or Web, is a system of documents accessible via the Internet, structured using hypertext links and the HTTP protocol.

    Thus, the Internet can be thought of as an infrastructure, and the World Wide Web as one of its services that allows users to find and share information. Every year, the internet's capabilities expand, encompassing new technologies and services, making it an essential tool in various areas of life, from education to business.

  • The OSI model is a conceptual framework that helps understand the processes occurring on the network. It divides the interactions of computer systems into seven layers, each responsible for specific functions. Why is this model necessary? First of all, it serves as a universal language for specialists, allowing them to effectively communicate and troubleshoot problems without delving into the implementation details of specific technologies.

    Each of the seven layers of the OSI model performs a unique task: from physical connection and data transfer to supporting applications, allowing systems to interact regardless of their internal structure. This hierarchy not only standardizes communication but also simplifies the development of new network technologies, allowing them to be integrated into existing systems.

    Thus, the OSI model can be viewed as a kind of "layer cake" of the Internet, where each layer plays its role, ensuring the holistic operation of the entire network.