So I was wondering what should be done with HTTP Content Negotiation regarding requests where the returned data may have multiple valid MIME types.
For example if say I have some arbitrary data that has the following possible MIME types:
text/data,application/x-data,application/data+xml
Given that there are multiple MIME types possible a client application requesting data of this form from my web application should reasonably expect to receive that kind of data regardless of which of the MIME types they use in their requests Accept header. BUT there will generally be some consensus about which type is the canonical type for this data (ie. one will be a proper registered MIME type with the IETF while the others will be pre-registration or pre-standardisation types).
So my question is should I in replying to these requests set my returned Content-Type header to be the canonical type or the requested type? Which is better practice?
Should I always return the canonical type or should I echo back the requested type to ensure compatibility with older/poorly written apps that haven't been updated? Currently I'm returning the canonical type as this seems to be to be a better approach and what most people are doing with the data types I'm working with.
This is somewhat subjective so if you think it should be community wiki instead of a question let me know and I'll consider changing it