Navigation
Introduction
HTTP Status Code 506-VARIANT ALSO NEGOTIATES is one of the classes of 5×× (Server Error) response code that indicates when the server offers many versions, this protocol allows a client to retrieve the best variant of a given resource.
In the context of Transparent Content Negotiation, the HyperText Transfer Protocol (HTTP) 506 Variant Also Negotiates response status code may be issued.
The Variation Also Negotiates status code denotes an internal server configuration issue in which the selected variant is configured to engage in content negotiation, indicating that it is not an appropriate negotiation endpoint.
Status
506 Variant Also Negotiates |
Understanding Status Code 506
RFC2295 was issued in 1998. It’s a proof-of-concept that aims to propose a new approach to content negotiation in HTTP. As far as I’m aware, it didn’t seem to gain any traction.
Traditionally, When an HTTP client wishes to negotiate content, they often provide one or more accept headers:
GET / HTTP/1.1 Accept: text/html; image/png; text/*; q=0.9 Accept-Language: en-CA; en Accept-Charset: UTF-8 Accept-Encoding: gzip, brotli |
RFC2295 aimed to establish a new method of doing so, one that offered a lot more flexibility and functionality. The RFC discusses picking certain variations based on HTML features supported by a browser, color capabilities, screen resolution, speed choice, printer paper size, and even content for specialized devices such as VR goggles and PDAs.
It may also produce a list of URLs for specified variants, which modifies the HTTP paradigm by providing each representation and variant its own URL and delivering everything with 300 Multiple Choices responses.
HTTP/1.1 300 Multiple Choices Date: Tue, 11 Jun 1996 20:02:21 GMT TCN: list Alternates: {"paper.1" 0.9 {type text/html} {language en}}, {"paper.2" 0.7 {type text/html} {language fr}}, {"paper.3" 1.0 {type application/postscript} {language en}} Vary: negotiate, accept, accept-language ETag: "blah;1234" Cache-control: max-age=86400 Content-Type: text/html Content-Length: 227 <h2>Multiple Choices:</h2> <ul> <li><a href=paper.1>HTML, English version</a> <li><a href=paper.2>HTML, French version</a> <li><a href=paper.3>Postscript, English version</a> </ul> |
506 Variant Also Negotiates is a new error code introduced by the RFC. This issue, to the best of my knowledge, occurs when a server is misconfigured and a ‘negotiating resource’ is referring to another resource that does not serve a representation but instead tries to negotiate.
I can picture a negotiating resource pointing to itself or establishing a redirection glance, for example. I believe that 506 is a specific error that a server may return in this situation.
Specification
Specification | Title |
RFC 2295, section 8.1: 506 Variant Also Negotiates | Transparent Content Negotiation in HTTP |
506 Code References
Symfony HTTP Status Constant | Response::HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL |
Related Articles
HTTP Status Code 207 Multi-Status |
HTTP Status Code 300-Multiple Choices |
HTTP Status Code 302 Found |
HTTP Status Code 204 – No Content |
FAQ
What does HTTP Status Code 506 mean?
HTTP Status Code 506-VARIANT ALSO NEGOTIATES is one of the classes of 5×× (Server Error) response code that indicates when the server offers many versions, this protocol allows a client to retrieve the best variant of a given resource.
The Variation Also Negotiates status code denotes an internal server configuration issue in which the selected variant is configured to engage in content negotiation, indicating that it is not an appropriate negotiation endpoint.
Conclusion
That should cover all the bases when it comes to the 506 Variant also negotiates issues. While there isn’t always much you can do when you get a 506 error, maybe some of these tips will come in handy the next time you get one.
I hope this article was able to help you with your doubts and queries related to the HTTP status code 506. Still, if there are any queries related to this topic, feel free to ask in the comment section, we would be happy to assist you. Thank you.
Saurabh Chalise