This is a common need for content negotiation, so if this is not documented yet, we should add a simple example about it. See https://github.com/symfony/symfony/pull/26036