406 Not Acceptable HTTP Status Code

Description

The HTTP status code 406 Not Acceptable is a part of the HTTP response status codes that a web server uses to communicate the status of the request made by a client. This specific status code is used when the server cannot generate a response that is acceptable to the client, based on the request headers the client sends. These request headers can include Accept, Accept-Charset, Accept-Encoding, Accept-Language, and Accept-Datetime, which specify the media types, character sets, encodings, languages, and versions of the resource that the client prefers.

When a client sends a request to the server, it can include these headers to tell the server what format of the response it expects. If the server cannot provide a response in a format that matches any of the client's acceptable options, it will return the 406 Not Acceptable status code. This informs the client that the server can process the request but refuses to do so because it cannot produce a response conforming to the criteria set by the client.

In practical terms, this could happen, for example, when a client requests a resource in a format that the server does not support or when there's no available content that matches the criteria specified by the client's request headers. The response accompanying a 406 status code typically includes a list of available content characteristics or an explanation of why the request cannot be fulfilled, helping the client to make a new request that the server can accept.

Status

HTTP
406 Not Acceptable

Common Causes

Here are the primary causes for an HTTP 406 status code:

  1. Accept Headers Mismatch: The most common cause of a 406 error is when the Accept header sent by the client does not match any content types offered by the server. The Accept header is used by HTTP clients to tell the server what content types they can handle. If the server cannot return a response matching any of those types, it might return a 406 error.

  2. Language or Character Encoding Issues: Similar to content type negotiation, a 406 error can also occur if the client specifies via Accept-Language or Accept-Charset headers that it only accepts responses in certain languages or character encodings that the server cannot provide.

  3. Mismatch in Encoding: If the server cannot provide a response in an encoding format that the client can accept (specified in the Accept-Encoding header), a 406 error might be returned.

  4. Strict Content Negotiation: In some cases, the server might be configured to perform strict content negotiation. If the server is strict about the resources it delivers based on the client’s request headers (like Accept, Accept-Language, Accept-Charset, etc.) and finds no suitable match, it could return a 406 status.

  5. Misconfigured Server or Client Headers: A misconfiguration on either the server or client side regarding what content types, languages, or encodings

Browser Support

The following table will show you the current browser support for the 406 Not Acceptable HTTP status code.

Desktop
Edge Chrome Firefox Opera Safari
YesYesYesYesYes
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
YesYesYesYesYesYes

Last updated by CSSPortal on: 1st April 2024