3460Re: [rest-discuss] Rebel
- Mar 3, 2003From: "Jeff Bone" <jbone@...>
>When you say "'first-class' entity", do you mean "resource"?
> 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.
> I'm playing with this with a current application. I've got a mess ofI use a similar technique with a new blog system I wrote. In the case 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:
> 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.
"folder" resources, I have the following:
For "entry" resources, I have:
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:
(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.
- << Previous post in topic Next post in topic >>