HTTP 406 Not Acceptable — What It Means

What HTTP status code 406 Not Acceptable means, when servers return it, and how to handle it correctly.

Published September 24, 2026

HTTP 406 Not Acceptable means the server cannot produce a response matching the Accept headers the client sent.

What it means

This is part of content negotiation: the client asked for a format, language or encoding the server cannot provide.

Common causes: Accept: application/xml on a JSON-only API; Unsupported language or encoding; Strict content negotiation.

On the wire

GET /report HTTP/1.1
HTTP/1.1 406 Not Acceptable
Accept: application/xml
A typical 406 exchange.

Practical examples

Test it from the shell

curl -i https://example.com/path   # look for HTTP 406

Handling 406 in code or config

res.format({ 'application/json': () => res.json(data), default: () => res.sendStatus(406) })

How to fix it

Request a supported media type; Relax the Accept header; Add support for the format.

1. Reproduce: curl -i <url>
2. Confirm the status is 406
3. Apply the fix above and re-test

Common mistakes

  • Request a supported media type
  • Relax the Accept header
  • Ignoring the response headers that explain the details.

Key takeaways

  • 406 means Not Acceptable.
  • HTTP 406 Not Acceptable means the server cannot produce a response matching the Accept headers the client sent.
  • Read the response headers and logs for the exact cause.

FAQ

Should I always return 406?

Many APIs fall back to a default format instead.

Is 406 a client or server error?

It is a client error status code, in the 4xx class.

More HTTP articles