Loading ...
Sorry, an error occurred while loading the content.

Re: [json] Media type for JSON?

Expand Messages
  • Mark Miller
    ... What are the media types for html and xml? -- Text by me above is hereby placed in the public domain Cheers, --MarkM
    Message 1 of 13 , Jul 26, 2005
    • 0 Attachment
      Roland H. Alden wrote:
      >>Therefore, any media type registered for JSON would likely be
      >>application/json.
      >
      >
      > You would seem to be correct assuming RFC 2046 is the controlling
      > standard. Quoting from that:
      >
      > 4.5. Application Media Type
      >
      > The "application" media type is to be used for discrete data which do
      > not fit in any of the other categories, and particularly for data to
      > be processed by some type of application program. This is
      > information which must be processed by an application before it is
      > viewable or usable by a user.


      What are the media types for html and xml?


      --
      Text by me above is hereby placed in the public domain

      Cheers,
      --MarkM
    • Martin Cooper
      ... Those are text/html and text/xml, respectively. See: http://www.iana.org/assignments/media-types/ -- Martin Cooper
      Message 2 of 13 , Jul 26, 2005
      • 0 Attachment
        On 7/26/05, Mark Miller <markm@...> wrote:
        > Roland H. Alden wrote:
        > >>Therefore, any media type registered for JSON would likely be
        > >>application/json.
        > >
        > >
        > > You would seem to be correct assuming RFC 2046 is the controlling
        > > standard. Quoting from that:
        > >
        > > 4.5. Application Media Type
        > >
        > > The "application" media type is to be used for discrete data which do
        > > not fit in any of the other categories, and particularly for data to
        > > be processed by some type of application program. This is
        > > information which must be processed by an application before it is
        > > viewable or usable by a user.
        >
        >
        > What are the media types for html and xml?

        Those are text/html and text/xml, respectively. See:

        http://www.iana.org/assignments/media-types/

        --
        Martin Cooper


        > --
        > Text by me above is hereby placed in the public domain
        >
        > Cheers,
        > --MarkM
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
      • Mark Miller
        ... JSON is more like html & xml than it is like javascript. Therefore, reasoning by precedent and analogy, I think the right answer is text/json. -- Text by
        Message 3 of 13 , Jul 26, 2005
        • 0 Attachment
          Martin Cooper wrote:
          > On 7/26/05, Mark Miller <markm@...> wrote:
          >
          >>Roland H. Alden wrote:
          >>
          >>>>Therefore, any media type registered for JSON would likely be
          >>>>application/json.
          >>>
          >>>
          >>>You would seem to be correct assuming RFC 2046 is the controlling
          >>>standard. Quoting from that:
          >>>
          >>>4.5. Application Media Type
          >>>
          >>> The "application" media type is to be used for discrete data which do
          >>> not fit in any of the other categories, and particularly for data to
          >>> be processed by some type of application program. This is
          >>> information which must be processed by an application before it is
          >>> viewable or usable by a user.
          >>
          >>
          >>What are the media types for html and xml?
          >
          >
          > Those are text/html and text/xml, respectively. See:
          >
          > http://www.iana.org/assignments/media-types/


          JSON is more like html & xml than it is like javascript. Therefore, reasoning
          by precedent and analogy, I think the right answer is text/json.


          --
          Text by me above is hereby placed in the public domain

          Cheers,
          --MarkM
        • Martin Cooper
          ... I disagree that JSON is more like HTML and XML than like JavaScript, particularly when it s specifically a subset of JavaScript. Further, to quote some
          Message 4 of 13 , Jul 26, 2005
          • 0 Attachment
            On 7/26/05, Mark Miller <markm@...> wrote:
            > Martin Cooper wrote:
            > > On 7/26/05, Mark Miller <markm@...> wrote:
            > >
            > >>Roland H. Alden wrote:
            > >>
            > >>>>Therefore, any media type registered for JSON would likely be
            > >>>>application/json.
            > >>>
            > >>>
            > >>>You would seem to be correct assuming RFC 2046 is the controlling
            > >>>standard. Quoting from that:
            > >>>
            > >>>4.5. Application Media Type
            > >>>
            > >>> The "application" media type is to be used for discrete data which do
            > >>> not fit in any of the other categories, and particularly for data to
            > >>> be processed by some type of application program. This is
            > >>> information which must be processed by an application before it is
            > >>> viewable or usable by a user.
            > >>
            > >>
            > >>What are the media types for html and xml?
            > >
            > >
            > > Those are text/html and text/xml, respectively. See:
            > >
            > > http://www.iana.org/assignments/media-types/
            >
            >
            > JSON is more like html & xml than it is like javascript. Therefore, reasoning
            > by precedent and analogy, I think the right answer is text/json.

            I disagree that JSON is more like HTML and XML than like JavaScript,
            particularly when it's specifically a subset of JavaScript.

            Further, to quote some fragments from RFC 2046:

            (From section 4.1)
            The "text" media type is intended for sending material which is
            principally textual in form.
            [...]
            Beyond plain text, there are many formats for representing what might
            be known as "rich text". An interesting characteristic of many such
            representations is that they are to some extent readable even without
            the software that interprets them. It is useful, then, to
            distinguish them, at the highest level, from such unreadable data as
            images, audio, or text represented in an unreadable form. In the
            absence of appropriate interpretation software, it is reasonable to
            show subtypes of "text" to the user, while it is not reasonable to do
            so with most nontextual data. Such formatted textual data should be
            represented using subtypes of "text".

            I think it would be pretty hard to argue that JSON is "rich text", or
            that it would be reasonable to show JSON code directly to the user.

            (From section 4.5)
            The "application" media type is to be used for discrete data which do
            not fit in any of the other categories, and particularly for data to
            be processed by some type of application program. This is
            information which must be processed by an application before it is
            viewable or usable by a user. Expected uses for the "application"
            media type include file transfer, spreadsheets, data for mail-based
            scheduling systems, and languages for "active" (computational)
            material. (The latter, in particular, can pose security problems
            which must be understood by implementors, and are considered in
            detail in the discussion of the "application/PostScript" media type.)

            IMO, this explains rather well the usage of JSON. It certainly seems
            much more appropriate to me than a "text" media type.

            --
            Martin Cooper


            > --
            > Text by me above is hereby placed in the public domain
            >
            > Cheers,
            > --MarkM
            >
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >
            >
          • Mark Miller
            ... By what stretch of the imagination is xml readable? -- Text by me above is hereby placed in the public domain Cheers, --MarkM
            Message 5 of 13 , Jul 26, 2005
            • 0 Attachment
              Martin Cooper wrote:
              >
              > (From section 4.1)
              > The "text" media type is intended for sending material which is
              > principally textual in form.
              > [...]
              > Beyond plain text, there are many formats for representing what might
              > be known as "rich text". An interesting characteristic of many such
              > representations is that they are to some extent *readable* even without
              > the software that interprets them. [Emphasis added]
              >
              > I think it would be pretty hard to argue that JSON is "rich text", or
              > that it would be reasonable to show JSON code directly to the user.

              By what stretch of the imagination is xml readable?

              --
              Text by me above is hereby placed in the public domain

              Cheers,
              --MarkM
            • Douglas Crockford
              ... I agree with MarkM on this one. JSON is not JavaScript. While it is a subset of JavaScript, its usage patterns are radically different. I think the right
              Message 6 of 13 , Jul 29, 2005
              • 0 Attachment
                > > JSON is more like html & xml than it is like javascript.
                > > Therefore, reasoning by precedent and analogy,
                > > I think the right answer is text/json.

                > I disagree that JSON is more like HTML and XML than like JavaScript,
                > particularly when it's specifically a subset of JavaScript.

                I agree with MarkM on this one. JSON is not JavaScript. While it is a
                subset of JavaScript, its usage patterns are radically different. I
                think the right answer is text/json.
              • Martin Cooper
                ... The usage patterns may be different, but if you read the portions of RFC 2046 that I quoted, those usage patterns still match application/json much better
                Message 7 of 13 , Jul 29, 2005
                • 0 Attachment
                  On 7/29/05, Douglas Crockford <douglas@...> wrote:
                  > > > JSON is more like html & xml than it is like javascript.
                  > > > Therefore, reasoning by precedent and analogy,
                  > > > I think the right answer is text/json.
                  >
                  > > I disagree that JSON is more like HTML and XML than like JavaScript,
                  > > particularly when it's specifically a subset of JavaScript.
                  >
                  > I agree with MarkM on this one. JSON is not JavaScript. While it is a
                  > subset of JavaScript, its usage patterns are radically different. I
                  > think the right answer is text/json.

                  The usage patterns may be different, but if you read the portions of
                  RFC 2046 that I quoted, those usage patterns still match
                  application/json much better than text/json.

                  --
                  Martin Cooper


                  >
                  >
                  >
                  >
                  >
                  > Yahoo! Groups Links
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                • Mark Miller
                  ... By the criteria you quoted, xml should be application/xml. -- Text by me above is hereby placed in the public domain Cheers, --MarkM
                  Message 8 of 13 , Jul 29, 2005
                  • 0 Attachment
                    Martin Cooper wrote:
                    > The usage patterns may be different, but if you read the portions of
                    > RFC 2046 that I quoted, those usage patterns still match
                    > application/json much better than text/json.


                    By the criteria you quoted, xml should be application/xml.


                    --
                    Text by me above is hereby placed in the public domain

                    Cheers,
                    --MarkM
                  • Martin Cooper
                    ... So? We re talking about JSON, not XML. Finding an example for which you disagree with the existing categorisation isn t much of a reason to not follow the
                    Message 9 of 13 , Jul 29, 2005
                    • 0 Attachment
                      On 7/29/05, Mark Miller <markm@...> wrote:
                      > Martin Cooper wrote:
                      > > The usage patterns may be different, but if you read the portions of
                      > > RFC 2046 that I quoted, those usage patterns still match
                      > > application/json much better than text/json.
                      >
                      >
                      > By the criteria you quoted, xml should be application/xml.

                      So? We're talking about JSON, not XML. Finding an example for which
                      you disagree with the existing categorisation isn't much of a reason
                      to not follow the spec when looking for the right categorisation for
                      JSON.

                      --
                      Martin Cooper


                      >
                      > --
                      > Text by me above is hereby placed in the public domain
                      >
                      > Cheers,
                      > --MarkM
                      >
                      >
                      >
                      >
                      >
                      > Yahoo! Groups Links
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.