Example HTTP Response
HTTP/1.1 506 Variant Also Negotiates- Circular reference in content negotiation
- Misconfigured transparent negotiation
- Variant resource references itself
What does this mean?
Infinite loop alert! The server got confused trying to pick the best version for you and ended up chasing its own tail.
Technical Definition
The server has an internal configuration error: transparent content negotiation results in a circular reference.
RFC Says
"The 506 (Variant Also Negotiates) status code indicates that the server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process."
Plain English:
506 means 'I messed up my content negotiation configuration.' This is part of transparent content negotiation (an obscure feature from RFC 2295) where the server has circular or incorrect negotiation rules. You'll probably never encounter this - it's a server misconfiguration error.
Common Misinterpretation
This is extremely rare and specific to transparent content negotiation, which is barely used. If you see 506, it's a server configuration bug. Application developers should never need to return this status code.
Ready-to-use code for returning this HTTP status in your application:
// Express.js
app.get('/example', (req, res) => {
res.status(506).json({
error: 'Variant Also Negotiates',
message: 'Your error message here'
});
});
// Native HTTP
const http = require('http');
http.createServer((req, res) => {
res.writeHead(506, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
error: 'Variant Also Negotiates',
message: 'Your error message here'
}));
}).listen(3000);