506 Variant Also Negotiates
A server configuration error in transparent content negotiation: a chosen variant is itself configured to negotiate, creating a loop.
At a glance
- Status code
- 506 Variant Also Negotiates
- Class
- 5xx, server error, the request looked fine and the server failed
- Defined in
- RFC 2295
- Cacheable by default
- no
- Response body
- Optional.
In detail
Transparent negotiation lets a resource point at variants. If a variant is also a negotiable resource, the server cannot resolve the choice and reports the misconfiguration honestly.
It is a 5xx rather than a 4xx because the fault is entirely on the server side. Nothing the client sends can fix it.
Find the variant that is marked as negotiable and make it a concrete representation instead.
Examples
HTTP/1.1 506 Variant Also Negotiates
Content-Type: text/plain
variant loop in content negotiationThings that catch people out
- Transparent content negotiation is almost unused, so tooling around this code is effectively nonexistent.
- It can look like a 500 in logs that group all 5xx together, which hides an easily fixed configuration error.
Try it: HTTP Request Builder
Build a request with any method, headers and body, send it, and read the status line the server returns.
HTTP Request Builder
LOCAL · Browser-OnlyBuild and test HTTP requests with custom headers and body
Authentication
Headers
Generate Code
curl -X GET 'https://api.example.com/endpoint' \
-H 'Content-Type: application/json'Showing a sample URL. Enter your endpoint above to update the snippet.
Related HTTP status codes
All http status codes →300 Multiple Choices
The request matched more than one representation and the server is asking the client to pick, rather than choosing for it.
500 Internal Server Error
The server hit an unexpected condition and cannot say anything more specific. It is the catch-all for unhandled exceptions.
406 Not Acceptable
The server cannot produce a representation that matches the Accept headers the client sent.
507 Insufficient Storage
The server cannot store the representation needed to complete the request, because it is out of space.
508 Loop Detected
The server aborted the operation because it detected an infinite loop while processing a request with WebDAV bindings.
510 Not Extended
The server requires further extensions to the request before it will fulfil it. From an experimental extension framework that was never widely adopted.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL