Implement Content Negotiation Support
There is now a use case for content negotiation in FLOW3:
For most requests, content negotiation based on the Accept HTTP header does not make sense because most browsers don't send meaningful information in them (some browsers for example say that they prefer "XML" over "HTML" which the user of course doesn't). However, for REST services it is a handy feature to control the output format by sending a respective Accept header. In some cases this might even be the only way to control the format, for example how else would you GET a resource "http://myhost/customers/" in different formats?
A proper implementation could work like this:
- if a format is defined through a @format property in the matching route, this format is used
- if no format has been defined by the route, the Accept header will be analyzed and compared with a list of supported formats by the controller. If another format than "HTML" is accepted by the client and the controller supports it, this format is chosen. If no other accepted format matches the supported formats, HTML is used.