Good Web APIs are just Web Sites
Excellent!
Both that presentation and an RDF Shopping example use content negotiation to serve different content types to clients. My previous signposts entry used a pretend HTML microformat. Different strategies for transferring understandable content from server to client.
The question I'm still asking myself is which of these two choices is better and why?:
- Separate and negotiated media types
- Single extensible media type
Candidates for extensible media types are HTML microformats and RDF (and Topic Maps and DITA and SGML Architectures).
The HTML Web has flourished (in part) because of Postel's Law:
"Be liberal in what you accept, and conservative in what you send."Is that enough to encourage using fewer, but extensible, media types over individual crafted media types?
3 comments:
John,
We on the simplewebservices.org working group have been grappling with these issues very recently.
We have reached a consensus on how we intend to proceed in relation to this. We will support "robust" services using RDF at high fidelity and "easy" services using JSON or HTML+microformats at a lower fidelity using server-driven content negotiation, i.e.
"robust"
Accept: application/rdf+xml
"easy"
Accept: text/json
or
Accept: text/html, */*
See:
http://tech.groups.yahoo.com/group/simplewebservices/message/120
IMO, this resolves a common conflict in REST between browsers and non-browser User Agents. It also favours the use of open, generic content types.
I am heading up the "robust" approach and Mike Schinkel will head up the "easy" approach.
http://simplewebservices.org
Alan,
I've subscribed to the list and checked out that thread.
To summarize: Different audiences will want one, or the other.
I'm still not sure it's that simple.
For example #4: Application vendors (leading to ecosystem of autonymous agents).
These agents would need service providers to support the application/rdf+xml content type. Asking that of many (the long tail?) content providers is going to be tough.
John
Our current thinking is that this is where pubishing frameworks that can be leveraged come into play. We plan on providing some open source "reference frameworks" to kick off the process.
Post a Comment