# Media type parameters: why are forbidden?

**URL:** <https://discuss.jsonapi.org/t/media-type-parameters-why-are-forbidden/119>\
**Category:** Uncategorized\
**Created:** [September 15, 2015, 11:23am UTC](https://discuss.jsonapi.org/t/media-type-parameters-why-are-forbidden/119 "2015-09-15T11:23:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![riccardo](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@riccardo](https://discuss.jsonapi.org/u/riccardo)\
**Post date:** [September 15, 2015, 11:23am UTC](https://discuss.jsonapi.org/t/media-type-parameters-why-are-forbidden/119/1 "2015-09-15T11:23:14Z")

</div>

Hi,  
my question is: why media type parameters are forbidden? ([http://jsonapi.org/format/#content-negotiation-servers](http://jsonapi.org/format/#content-negotiation-servers)).  
Some media type parameters are very useful, for instance “charset”. Why I cant use it?  
Thanks!

---

<div class="post-metadata">

**Author:** ![ethanresnick](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@ethanresnick](https://discuss.jsonapi.org/u/ethanresnick)\
**Post date:** [September 16, 2015, 9:57pm UTC](https://discuss.jsonapi.org/t/media-type-parameters-why-are-forbidden/119/2 "2015-09-16T21:57:53Z")

</div>

Basically, a media type is meant to be a standardized, globally-known contract—it’s processing rules aren’t supposed to change from implementation to implementation. That’s why the [IANA specification](https://tools.ietf.org/html/rfc6838#section-4.3) for how to register a media type says:

> the names, values, and meanings of any parameters MUST be fully specified when a media type is registered in the standards tree, and SHOULD be specified as completely as possible when media types are registered in the vendor or personal trees.

So, if JSON API were to let users specify their own media type parameters, the same parameter would mean different things in different JSON API implementations, and that’s contrary to the spirit of a media type. (Implementation-specific information should be in the _content_ of the response, not in the information about _what type it is_; that needs to be broadly understood.)

&nbsp;

About the `charset` parameter in particular: the JSON media type, which JSON API extends, actually [doesn’t define any parameters](https://tools.ietf.org/html/rfc4627#section-6), including `charset`. Charset isn’t necessary because JSON is always unicode, and the type of Unicode in use can be figured out [just by analyzing the content received](https://tools.ietf.org/html/rfc4627#section-3). (Compliant JSON implementations will do this automatically.)

However, some web browsers and other clients used to mistakenly add a `charset` parameter on JSON requests, so a later revision of the JSON specification clarified that any `charset` provided can just be ignored (see the note at the bottom of [this section](http://rfc7159.net/rfc7159#rfc.section.11)). Luckily, all browsers have stopped doing this now, except for Firefox, which is [working on a fix](https://bugzilla.mozilla.org/show_bug.cgi?id=918742#c3).

In order to support this Firefox bug, JSON API is [going to add](https://github.com/json-api/json-api/pull/874) support for clients sending a `charset` parameter, which servers can just ignore. However, servers still won’t be allowed to use this parameter because, again, there’s no need for them to with JSON data (and no bugs to justify us making an exception).

If you feel there are features you need to support, and you were going to do so with a media type parameter, please open another thread on here and we can help you find alternate solutions.

---

<div class="post-metadata">

**Author:** ![riccardo](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@riccardo](https://discuss.jsonapi.org/u/riccardo)\
**Post date:** [September 17, 2015, 9:43am UTC](https://discuss.jsonapi.org/t/media-type-parameters-why-are-forbidden/119/3 "2015-09-17T09:43:55Z")

</div>

Thank you very much for the answer! 😉

I have already observed that Firefox adds a charset parameter on JSON requests. I hope that a fix will come soon.

Bye.
