Original address: http://rest.elkstein.org/
Learn rest: a tutorial
A fast-training courseRest-
RePresentationalSTateTRansfer, a new approach to systems architecture and a lightweight alternative to Web Services
Rest-transition of expressive state-quick learning tutorial, a new system architecture method that can replace the lightweight Web service protocol.
_______________________________________________________________________________________
In rest, the server is usually an XML file, for example:
<parts-list> <part id="3322"> <name>ACME Boomerang</name> <desc> Used by Coyote in <i>Zoom at the Top</i>, 1962 </desc> <price currency="usd" quantity="1">17.32</price> <uri>http://www.acme.com/parts/3322</uri> </part> <part id="783"> <name>ACME Dehydrated Boulders</name> <desc> Used by Coyote in <i>Scrambled Aches</i>, 1957 </desc> <price currency="usd" quantity="pack">19.95</price> <uri>http://www.acme.com/parts/783</uri> </part></parts-list>
However, other formats can also be used. Unlike the soap service, rest is not bound to XML. Possible formats of rest are CSV (comma-separated values) and JSON (JavaScript Object Notation ).
Each format has its own advantages and disadvantages. XML is easy to expand (the client needs to ignore unfamiliar fields) and is type-safe; CSV is more compact; JSON is easy to be processed by the Javascript client (or in other languages ).
Except in special cases, rest does not support HTML and other formats, such as formats that make sense to humans, or formats that are not easy to process on the client. In particular, the rest service requires that a human-readable document be returned or the entire WWW be viewed. In fact, we found that HTML is the most commonly used rese response format .......