HTTP Error 406 – Not Acceptable

A girl working at her computer with a cup of coffee and a notepad

HTTP Error 406 arises when there is a mismatch between the data types a client is willing to accept and the data types a web server intends to return. This error is predominantly related to the ‘accept headers’ sent by the client to the server, detailing the types of data the client is capable of processing.

Role of Accept Headers in HTTP Error 406

Accept headers play a crucial role in determining the data exchange compatibility between a client and a web server. These headers include:

  • Accept: Specifies MIME types the client can process (e.g., HTML, GIF);
  • Accept-Charset: Indicates the character sets acceptable to the client;
  • Accept-Encoding: Defines data encoding formats the client understands;
  • Accept-Language: Lists natural languages the client accepts;
  • Accept-Ranges: Determines if the client accepts byte-range requests.

When a web server identifies that the data it is about to return does not align with the client’s accepted headers, it results in a 406 error.

The HTTP Cycle and the Occurrence of Error 406

The HTTP cycle, essential for web communication, involves:

  • Obtaining an IP address from the domain name of the site;
  • Establishing an IP socket connection to that address;
  • Writing and receiving an HTTP data stream through the socket.

Error 406 manifests in the final phase of this cycle when the client recognizes the status code as ‘406’ in the returned HTTP data stream.

General Approaches to Resolve HTTP Error 406

HTTP Error 406 is uncommon in web browsers, as they generally accept all data types from servers. Resolving this error for non-browser clients involves examining the accepted headers and the server’s returned data stream. Without access to the source code, addressing this issue requires technical support from the systems’ developers.

Resolving 406 Errors in CheckUp Down

In the context of CheckUp Down, the occurrence of a 406 error usually points to programming issues either in our system or the managing web server. Our approach does not involve the use of accept headers, negating the typical cause for a 406 error. If such an error arises, users are advised to contact us for assistance, as resolving this issue often necessitates collaboration with ISPs and web server software vendors to identify the error’s root cause.

Comparative Analysis of Common HTTP Status Codes

Status CodeDescriptionTypical CauseClient or Server Error
400 Bad RequestThe server cannot process the request due to a client errorIncorrect request syntax or invalid request parametersClient Error
403 ForbiddenThe server understands the request but refuses to authorize itLack of permission to access the requested resourceClient Error
404 Not FoundThe server cannot find the requested resourceNon-existent URL or the resource has been removedClient Error
406 Not AcceptableThe server cannot meet the requirements of the accept headers sent by the clientIncompatible accept headers from the clientClient Error
500 Internal Server ErrorA generic error message indicating a server-side problemServer misconfiguration, scripting errors, or resource exhaustionServer Error
502 Bad GatewayThe server received an invalid response from the upstream serverIssues with an intermediary server or gatewayServer Error
503 Service UnavailableThe server is temporarily unable to handle the requestServer overload or maintenanceServer Error

Understanding the 414 Request-URI Too Large Error

The 414 Request-URI Too Large error, similar in nature to the 406 error, occurs within the HTTP transaction cycle but under different circumstances. This error is encountered when a client, such as a web browser, sends a request with a URI (Uniform Resource Identifier) that exceeds the server’s capacity to process. Key aspects include:

  • Causes: The primary cause of a 414 error is a URL that is significantly longer than what the server is configured to handle. This can happen with excessively long query strings or when a client inadvertently generates a complex request;
  • Server Configuration: Typically, web servers have a predefined limit for URL length, which can vary depending on the server’s configuration. Commonly, servers allow URLs up to 2048 or 4096 characters;
  • Impact on HTTP Cycle: Similar to the 406 error, the 414 error occurs in the last stage of the HTTP cycle, where the server recognizes the oversized URI and returns the 414 status code;
  • Resolution Strategies: Resolving a 414 error generally involves shortening the request URI or reconfiguring the server to handle longer URIs. For web developers, ensuring that URLs are concise and within typical length limits is crucial.

The 414 error, while less common, underscores the importance of understanding server limitations and client request structures in maintaining efficient and error-free HTTP communication.

Video Guide

To answer all your questions, we have prepared a video for you. Enjoy watching it!

Conclusion

Understanding and resolving HTTP Error 406 involves comprehending the role of accept headers in HTTP communication, recognizing its occurrence in the HTTP cycle, and applying appropriate resolution strategies. This guide provides a systematic overview of the error for both general web users and CheckUp Down clients, aiding in effective error management.