Re: [rest-discuss] Link relations [was: A media type for case files, dossiers and documents]
- Kevin Duffey wrote:
>Right -- that API document is your HTML. Which doesn't mean anyone has
> 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.
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
>Doesn't matter. Nobody coding a consumer for your API will understand
> 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
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.
On Sun, Dec 5, 2010 at 5:12 PM, Eric J. Bowman <eric@...> wrote:
> 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 "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.