rest/examples: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
m (en-US)
 
(12 intermediate revisions by 6 users not shown)
Line 6: Line 6:


Quoting the wikipedia [http://en.wikipedia.org/wiki/Representational_State_Transfer#REST_versus_RPC REST] article:
Quoting the wikipedia [http://en.wikipedia.org/wiki/Representational_State_Transfer#REST_versus_RPC REST] article:
: In general, however, REST for data does not  yet have a generally-accepted, standard format corresponding to  HTML for documents, so each REST client must be custom-written to  deal with XML at a fairly low level, and crawling XML data over REST is difficult (since it is not always easy to identify links).  Proposals for a standard, generic format for use with REST based  systems have included RDF, XTM, Atom, RSS (in its various flavours), and Plain Old XML (POX) with XLink to handle links
: In general, however, REST for data does not  yet have a generally-accepted, standard format corresponding to  HTML for documents, so each REST client must be custom-written to  deal with XML at a fairly low level, and crawling XML data over REST is difficult (since it is not always easy to identify links).  Proposals for a standard, generic format for use with REST based  systems have included RDF, XTM, Atom, RSS (in its various flavors), and Plain Old XML (POX) with XLink to handle links


In short, there isn't a clean design pattern for the optimal way to encode and use REST, which is precisely the sort of thing a microformats approach can provide.
In short, there isn't a clean design pattern for the optimal way to encode and use REST, which is precisely the sort of thing a microformats approach can provide.
Line 18: Line 18:
''Links to public web pages, either popular or insightful''
''Links to public web pages, either popular or insightful''


=== [Example #1 (url)] ===
=== [http://tools.ietf.org/wg/atompub/draft-ietf-atompub-protocol/ ATOM Publishing] ===
http://ietf.org/internet-drafts/draft-sayre-atompub-protocol-basic-03.txt
Currently the best use of REST in a standard protocol.
pre
They're even discussing using XOXO!
  escaped <tags>


=== [Example #2 (url)] ===
=== [http://images.amazon.com/images/G/media/i3d/01/associates/ecs-dg-20051005.pdf Amazon E-Commerce] ===
  pre
 
  escaped <tags>
Not a very good example, as they only have a single URI for the "REST" API, and do everything with url-encoding.
 
=== [http://del.icio.us/doc/api Delicious API] ===
 
Their so-called REST API is not, really. Here's a good critique which includes a more RESTful representation:
 
http://www.peej.co.uk/articles/restfully-delicious
 
== Rails and MOFO ==
 
Web Services via JSON and Microformats
 
http://www.infoq.com/articles/rails-rest-and-microformats


== Existing Practices ==
== Existing Practices ==
Line 34: Line 45:
* ''Link to related pages as they become available''
* ''Link to related pages as they become available''
** [[rest-brainstorming]]
** [[rest-brainstorming]]
[http://www.opendarwin.org/~drernie/rest-api.html]
** - proposal
** - proposal
** -microformat
** -microformat
== See Also ==
== See Also ==
* [[forms-examples]]
* [[forms-examples]]
* [http://en.wikipedia.org/wiki/OpenSearch OpenSource search aggregation]
* [http://en.wikipedia.org/wiki/OpenSearch OpenSource search aggregation]
* [http://simpletest.sourceforge.net/SimpleTest/tutorial_Browser.pkg.html PHP form filler]
* [http://en.wikipedia.org/wiki/WSDL WSDL]
* [http://en.wikipedia.org/wiki/Sitemap Sitemaps]


* ''Normative references for tags used''
* ''Normative references for tags used''

Latest revision as of 23:50, 2 September 2007

XHTML-REST Examples

These are some examples of how people are currently implementing REST web services (usually in XML), to provide some context for how best to implement them in XHTML.

The Problem

Quoting the wikipedia REST article:

In general, however, REST for data does not yet have a generally-accepted, standard format corresponding to HTML for documents, so each REST client must be custom-written to deal with XML at a fairly low level, and crawling XML data over REST is difficult (since it is not always easy to identify links). Proposals for a standard, generic format for use with REST based systems have included RDF, XTM, Atom, RSS (in its various flavors), and Plain Old XML (POX) with XLink to handle links

In short, there isn't a clean design pattern for the optimal way to encode and use REST, which is precisely the sort of thing a microformats approach can provide.

Participants

Real-World Examples

Links to public web pages, either popular or insightful

ATOM Publishing

Currently the best use of REST in a standard protocol. They're even discussing using XOXO!

Amazon E-Commerce

Not a very good example, as they only have a single URI for the "REST" API, and do everything with url-encoding.

Delicious API

Their so-called REST API is not, really. Here's a good critique which includes a more RESTful representation:

http://www.peej.co.uk/articles/restfully-delicious

Rails and MOFO

Web Services via JSON and Microformats

http://www.infoq.com/articles/rails-rest-and-microformats

Existing Practices

  • Summary of common patterns discovered
  • Other attempts to solve The Problem

Proposal

  • Early drafts
  • Link to related pages as they become available

See Also


  • Normative references for tags used