In HTTP content negotiation, a client sends the media types it can handle in Accept. The server chooses a representation and reports its type in Content-Type. If none matches, it may return 406 or choose another response according to its behavior.
The demo alternates JSON and text Accept headers for one resource, changing the response shape. When caching, use Vary for request headers that influence the representation so variants do not mix.
When to use
Use it when one API resource is available in JSON, text, or other representations.