4 ms·
Accept: application/json; version=2 Is that a standard-compliant media type? `version` doesn't appear to be associated with application/json in the IANA media
by mnarayan01 14y ago
Accept: application/json; version=2
Is that a standard-compliant media type? `version` doesn't appear to be associated with application/json in the IANA media type registry, and I couldn't find anything definitive about adding arbitrary parameters.
- masklinn 14y agoI'm pretty sure parameters are not limited to those provided by IANA (just as media types are not necessarily IANA-registered incidentally) e.g. RFC2616's Accept doc shows a `level` parameter to text/html which is not IANA-specified (and seems entirely unspecified)
- mnarayan01 14y agoYea I saw the use of level in the example but didn't think to look at the text/html spec to see if it was there. That would seem to imply that you are correct (though it would be nice if there were an explicit answer on this, if only for purely OCD reasons). > just as media types are not necessarily IANA-registered incidentally Per RFC4288 I believe they must be if they are in the standard tree (i.e. the name does not contain a '.' or an 'x-' prefix for historical reasons).
- zedr 14y agoYes, it is compliant. In this example, the (version, 2) key/value pair is an accept-extension. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html Another example of header field extensions could be `Content-Type: text/html; level=3`