Free Newsletters
Technology & Business Daily

InfoWorld
Log-in | Register

  Thursday, April 21, 2005 

Making it easy to do the right thing

You'd think that a language with only a handful of verbs, only two of which are widely spoken, would be easy to learn. Not so in the case of the Hypertext Transfer Protocol, though. After more than a decade we're still sorting out how and why to use its most common verbs: GET and POST.

This perennial issue recently flared up again when Microsoft's Dare Obasanjo noted that three popular services had got it wrong. Bloglines, Flickr, and del.icio.us all offer APIs that claim to be RESTful -- that is, to conform to the Representational State Transfer principles of HTTP -- yet each violates those principles by allowing GET in some cases where only POST should be allowed. [Full story at InfoWorld.com]

For this column I tried converting a resource-altering GET request into a POST using four HTTP clients: curl, Python, Perl, and JavaScript. It's almost effortless in the first two cases, not so in the last two. I found myself wishing that Perl's LWP::Simple and JavaScript's location.href had a data option like curl and Python's urllib.urlopen do.

Here's the JavaScript example that raised the question for me. My first Greasemonkey script added a private checkbox to the del.icio.us posting form, then rewrote the page, adding a script to process the form. That script was able to use location.href to update del.icio.us, but not to update a private instance of scuttle, which (correctly) refused to allow an HTTP GET.

If JavaScript is going to be an appropriate technology of intermediation, would it make sense for it to offer an easy way to issue a non-interactive HTTP POST?

 


Recent Entries


















































Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS  CAREERS   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist