From: Yohanes Santoso Date: 2004-08-27T03:22:41+09:00 Subject: Re: RESTless Ruby? djberg96@hotmail.com (Daniel Berger) writes: > I've seen a few discussions, but no actual implementation - or is > there no such thing really, since it's HTTP? Most REST over HTTP implementation is really thin to almost non-existent as REST is mostly a discipline in URI creation and access, rather than protocol specification like in xml-rpc and soap. There is no specification on data format exchanged between the client and server. Some would use HTML, some plain text, but the most common one is XML with custom schema. > I can read all the papers in the world, but I live by examples! :) Following is some example of REST-ful URI: GET /document?id=3 #=> get document #3 POST /document (posted data: id=3&author='another person') #=> update document #3 PUT /document (document data putted) #=> insert new document Some hints: 1. Move session handling or state-related info outside of the REST server, i.e. ideally it should be stateless. 2. If you can't move it outside of the REST server, make it a first-order resource: /session or /state. 3. Try to use only nouns to name the resources: /view_document contains verb, /document would be better. The verb is implied from the HTTP request method you use, e.g.: GET -> view, POST -> update, PUT -> insert. Regarding REST implementation in Ruby, any decent HTTP server would do; WEBrick is one of them. YS.