Search code examples
httphttp-headersmime-typesspecificationsw3c

Why does 'x-www-form-urlencoded' begin with 'x-www', when other standard content types do not?


I understand that in the past, it was standard for custom headers names to use the prefix "X-" (I'm aware it no longer is considered standard to do this), but I've been unable to find if there is any relationship between this naming convention and the value ("application/x-www-form-urlencoded"). Did it start out as a custom content-type value that was later adopted or something?

I found this link here, which certainly was interesting, but have been unable to find the answer to my question.

Does anybody know the reason this prefix was chosen, and what it signifies?


Solution

  • it was standard for custom headers names to use the prefix "X-"

    Actually … no, not at all. To be precise: It has never been a standard, just a best practice. It allowed implementors to introduce new content types and codings without the need to write an entire RFC for it. Nowadays the IANA Media Type Registry is good for that. RFC 6648 put an end to this practice.

    The reason application/x-www-form-urlencoded is prefixed in this way (it is listed as a proper MIME type in said registry, btw)) stems from the fact that it is a "custom" method of structuring the query string in a URL. That part has never seen proper regulation. The people behind HTML just went and did it, which fully justified the prefix.