W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2006

[whatwg] JSONRequest

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 30 Mar 2006 13:49:01 +1000
Message-ID: <442B552D.4030104@lachy.id.au>
Gervase Markham wrote:
> Douglas Crockford wrote:
>> I have modified the JSONRequest proposal so that the Content-Type in
>> both directions must be application/json/request.
> 
> Er, why? Having two slashes in a content type is either extremely weird
> or completely illegal (glancing at the RFC, I'm not certain which).
> http://www.mhonarc.org/~ehood/MIME/2046/rfc2046.html

RFC 2616 states:

        media-type     = type "/" subtype *( ";" parameter )
        type           = token
        subtype        = token

        token          = 1*<any CHAR except CTLs or separators>
        separators     = "(" | ")" | "<" | ">" | "@"
                       | "," | ";" | ":" | "\" | <">
                       | "/" | "[" | "]" | "?" | "="
                       | "{" | "}" | SP | HT

And RFC 2045 says something very similar.  So the second '/' is indeed 
illegal.

If application/json isn't acceptable (though I don't know why it 
wouldn't be), then try a hyphen instead: application/json-request

-- 
Lachlan Hunt
http://lachy.id.au/
Received on Wednesday, 29 March 2006 19:49:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:45 UTC