SiteError.comYour friendly guide to HTTP status codes
Status CodesBlog
  1. Home
  2. 4xx Client Error
  3. 406 Not Acceptable

406 Not Acceptable

🍽️
406
Not Acceptable
!
?

Example HTTP Response

HTTP Response
HTTP/1.1 406 Not Acceptable
Content-Type: application/json

{"available": ["application/json", "application/xml"]}
Common Causes
  • Accept header doesn't match available formats
  • Language not supported
  • Content negotiation failed
Technical Details

What does this mean?

Picky eater alert! You asked for something in a format the server can't serve. Like ordering sushi at a pizza place.

Technical Definition

The server cannot produce a response matching the list of acceptable values defined in the request's headers.

RFC Says

"The 406 (Not Acceptable) status code indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation."

Plain English:

The server can't produce a response in any of the formats you requested via Accept headers. For example, if you requested JSON (Accept: application/json) but the server only provides XML, it returns 406.

Common Misinterpretation

Most servers ignore Accept headers or send a default format instead of returning 406. Strict adherence to content negotiation with 406 is rare in practice. Many APIs just return JSON regardless of Accept headers.

View RFC Documentation
Code Snippets

Ready-to-use code for returning this HTTP status in your application:

Node.js
// Express.js
app.get('/example', (req, res) => {
  res.status(406).json({
    error: 'Not Acceptable',
    message: 'Your error message here'
  });
});

// Native HTTP
const http = require('http');

http.createServer((req, res) => {
  res.writeHead(406, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({
    error: 'Not Acceptable',
    message: 'Your error message here'
  }));
}).listen(3000);

406 Not Acceptable FAQ

What causes a 406 Not Acceptable error?

Accept header doesn't match available formats. Language not supported. Content negotiation failed.

405 Method Not Allowed407 Proxy Authentication Required

Popular Status Codes

  • 200 OK
  • 301 Moved Permanently
  • 302 Found
  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable

Compare Codes

  • 401 vs 403
  • 301 vs 302
  • 404 vs 410
  • 500 vs 502
  • Compare any codes →

Categories

  • Informational
  • Success
  • Redirection
  • Client Error
  • Server Error
  • NGINX
  • Cloudflare
  • AWS ELB
  • Microsoft IIS

Tools

  • Cheat Sheet
  • Status Code Quiz
  • URL Checker
  • API Playground
  • Blog

© 2026 SiteError.com. All rights reserved.