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

Re: [rest-discuss] Link relations [was: A media type for case files, dossiers and documents]

Expand Messages
  • Eric J. Bowman
    ... Right -- that API document is your HTML. Which doesn t mean anyone has to parse that HTML, they can use XML or JSON directly. The drawback is that if you
    Message 1 of 88 , Dec 3, 2010
    • 0 Attachment
      Kevin Duffey wrote:
      >
      > I am however having a hard time thinking about telling clients that
      > they basically need to parse html to use my API. I much rather say
      > "for /orders, you get this chunk of xml back with these potential
      > elements.. parse it to get the data you need". (...) I would
      > obviously have some sort of api doc that would explain the response.
      >

      Right -- that API document is your HTML. Which doesn't mean anyone has
      to parse that HTML, they can use XML or JSON directly. The drawback is
      that if you change that API, any user-agent directly accessing the raw
      data will break; whereas if they're parsing your HTML they'll be updated
      automatically.

      >
      > I guess what I am grappling with is that for the most part, I would
      > suspect most services like the one I am messing around with to learn,
      > would be used by specific clients, not anyone and everyone out on the
      > web.
      >

      Doesn't matter. Nobody coding a consumer for your API will understand
      a custom media type without training. Whereas if you express your API
      as HTML, you don't have this problem; anyone will be able to understand
      it provided they understand HTML (a safe assumption), and you won't
      need any custom media types.

      -Eric
    • Peter Williams
      On Sun, Dec 5, 2010 at 5:12 PM, Eric J. Bowman wrote: ... I see in table 5-1[1] media type is listed in the modern web
      Message 88 of 88 , Dec 5, 2010
      • 0 Attachment
        On Sun, Dec 5, 2010 at 5:12 PM, Eric J. Bowman <eric@...> wrote:

        <snip/>

        > Anyway, it was previously discussed that the sentence in question is a
        > bit buggy, which is in part to blame for the confusion.  REST can be
        > instantiated over IP by any protocol using media types, and meeting the
        > other constraints like caching, not just by HTTP.  But the media type
        > is the means by which resource and representation are decoupled.

        I see in table 5-1[1] "media type" is listed in the modern web
        examples column. That does seem to bolster your argument. However,
        the dissertation uses the term while describing the style rather than
        http specifically. Your interpretation would seem to imply that a
        stack (networking system and restful application protocol) that
        eschewed iana registered media types would have to have to use a
        different term for "the flavor of representations".

        Perhaps it is a bug that the dissertation uses "media type" in the way
        it does. However, that cannot be undone. Given that the dissertation
        does use the term the way it does i stand by my assertion that there
        are two valid uses of "media type". One which means a data format
        that is registered with iana, and another that means a type, defined
        by a specification, of representation used in a restful system.

        Regardless, it seems a point of little importance.

        [1]: <http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#tab_5_1>

        Peter
        barelyenough.org
      Your message has been successfully submitted and would be delivered to recipients shortly.