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

3460Re: [rest-discuss] Rebel

Expand Messages
  • Seairth Jacobs
    Mar 3, 2003
    • 0 Attachment
      From: "Jeff Bone" <jbone@...>
      >
      > Yet Accept: (and all header-based approaches) do nonetheless introduce
      > another namespace and a fair bit of complexity as well. IFF the
      > particular representations in question can / should be regarded as
      > "first-class" entities in their own right, distinguishing them from
      > each other via different URI is certainly do-able.

      When you say "'first-class' entity", do you mean "resource"?

      > I'm playing with this with a current application. I've got a mess of
      > little resources, all of which have various representations. This goes
      > beyond mere MIME type to functional types; for example, a given piece
      > of content might also have an "editor" representation which
      > encapsulates the content in a Web-based interface for editing and
      > saving said content. Hence, I've got URIs like:
      >
      > /~jbone/Journal/2003/03/01/33?repr=editor-xhtml
      > /~jbone/Journal/2003/03/01/33?repr=printable-xhtml
      > /~jbone/Journal/2003/03/01/33?repr=rss2.0
      > /~jbone/Journal/2003/03/01/33?repr=xml-raw
      > /~jbone/Journal/2003/03/01/33?repr=rdf-factset
      >
      > This allows all of these things to be directly accessed by simply
      > GETting them, rather than having to dip into conneg. AND it works well
      > for alternate representations that have some associated functionality,
      > beyond just this or that static format.

      I use a similar technique with a new blog system I wrote. In the case of
      "folder" resources, I have the following:

      /blog?form=addentry
      /blog?form=addfolder
      /blog?form=editfolder

      For "entry" resources, I have:

      /blog/12?form=editentry
      /blog/12?form=trackback

      In each of these cases, a form related to an aspect of the resource is
      returned. This would be equivalent to your "?repr=editor-xhtml", I think.

      Independently, I also allow the folders to be returned as RSS. In case the
      client is not using the Accept: header (my blog system supports conneg), you
      can append the following query to the folder:

      /blog?rss=0.91
      /blog?rss=0.92
      /blog?rss=0.93
      /blog?rss=2.0

      (depending on which version you want). I think this would be similar to
      your "?repr=rss2.0". I just use two different query parameters, but is
      otherwise the same. However, I still treat all of these representations as
      the same resource. I do not consider them sub-resources or anything like
      that. I agree that a form to add a subfolder looks a lot different from an
      rss feed, but who says that a given representation of a resource must convey
      all of that resource?

      Now, I do also have conneg support in the places that it can be used. For
      instance, submitting a request to a folder with an "Accept: text/xml", you
      will get back the RSS2.0 feed. Now, if I needed to return another xml
      representation which also used "text/xml" as the mime-type, I would probably
      have to fall back to the query string method.

      ---
      Seairth Jacobs
      seairth@...
    • Show all 10 messages in this topic