Friday, February 24th, 2006

Using a REST Web Service with Ajax

Category: Ajax

In this OnLamp.com article, Nic Ferrier explains how to use simple Ajax techniques to interface with a remote REST (Representational State Transfer) web service.

Everyone’s talking about REST these days. Lots of people are still struggling with it, and there’s good reason for that–REST is actually quite difficult to fit into the browser-based HTML Web. As far as I’m concerned, this is fair enough; REST is primarily a web services platform, an alternative to CORBA, SOAP, and XMLRPC, not a user interface. Still, at least some of the time, it’s nice to use a REST API as the foundation for a webapp. On the other hand, Ajax can be really complicated, and it always seems to involve lots of different bits of code.

That is the point of this article. REST’s clean definition of an application’s architecture solves at least some of the problems with Ajax; and using Ajax to a REST webapp leaves the REST API uncomplicated and pure.

They detail the implementation of a REST web service as written in Python, including in it the ability to manage a user’s feeds through various HTTP methods (GET, POST, and DELETE) and calls. There is a block of code for each that performs the operation based on the input parameters (or lack thereof).

Last, but not least, they show the simple Ajax implementation – creating the XMLHttpRequest object “by hand” – that can make the requests to the web service. It’s then possible to visually manage the feeds via the list contained in the form with checkboxes to the side of each.

Posted by Chris Cornutt at 8:32 am
3 Comments

++++-
4 rating from 22 votes

3 Comments »

Comments feed TrackBack URI

Check out the “patent” on AJAX. I hope this doesn’t last long.

Comment by Marlo — February 27, 2006

Check out the “patent” on ajax. I hope this doesn’t last.
http://www.informationweek.com/story/showArticle.jhtml?articleID=180206472&cid=RSSfeed_IWK_News

Comment by Marlo — February 27, 2006

hello

Comment by fsdf — March 9, 2006

Leave a comment

You must be logged in to post a comment.