Languages
[Edit]
EN

HTTP - status: 406 Not Acceptable

13 points
Created by:
Nikki-Mathews
517

In this short article we would like to explain what  406 Not Acceptable status means in HTTP response and when occurs.

When server returns status 406 for HTTP request (Not Acceptable) it means the server is not albe to match acceptable values located in headers in client request.

During negotation can be used following headers:

  • Accept
  • Accept-Charset
  • Accept-Encoding
  • Accept-Language

Practical example

Edit

Let's suppose client sends following headers (user web browser tells that is able to handle only value combinations from headers):

Server is not able to provide any combination from Accept citeria and returns 406 status.

Any combination means:

Example web browser request:

Example server response:

Amount of reasones why server is not able to proceed with user requirements can be different, but as example we can use: lack of support for application/json MIME type - user expected JSON response for XHR / Ajax request.

Solutions:

  • as server owner you can provide following response by proper response implementation,
  • or requester can change request requirements and asks with different MIME type.

 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

HTML

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join