Question

I'm using a web service(API) framework that does some magic behind the scene for different content-types requests.

I want to take advantage of that by creating responses like application/verbose+json but the actual content will still be application/json.

I've implemented it, tested it from a jquery.ajax call in chrome and it all works.

Is there a reason this is wrong or might not work in production/long run?

Not relevant to the question but just in case you're wondering about what it's written in: - server side: tastypie(python on django) - client side: javascript/coffeescript on backbone

Was it helpful?

Solution 2

Custom content-type hasn't raised any issue until now in production, so i'll solve this issue by saying it's safe.

OTHER TIPS

Internet Media Types (what you call content types) form a global space of names. If you use a "custom" name, you risk that there'll be future name collisions.

If you really think your custom name is needed, please consider registering it, see https://www.rfc-editor.org/rfc/rfc6838 (there are also vendor and personal spaces).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top