The Artima Developer Community
Sponsored Link

Java Buzz Forum
GET, POST, PUT and DELETE in REST

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Kevin Dangoor

Posts: 1101
Nickname: tazzzzz
Registered: Jul, 2003

Kevin Dangoor is a developer with JSTOR
GET, POST, PUT and DELETE in REST Posted: Apr 21, 2005 9:59 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Kevin Dangoor.
Original Post: GET, POST, PUT and DELETE in REST
Feed Title: Blue Sky On Mars
Feed URL: http://www.blueskyonmars.com/feed/?cat=8%2C13%2C14
Feed Description: Kevin Dangoor's Weblog of Technology, Entertainment and Life - Java only feed. For all articles, check out http://www.blueskyonmars.com
Latest Java Buzz Posts
Latest Java Buzz Posts by Kevin Dangoor
Latest Posts From Blue Sky On Mars

Advertisement

No, I'm not yelling in the title. I'm just following up on Dare Obasanjo's post about misunderstanding REST: A look at the Bloglines, del.icio.us and Flickr APIs. Dare's complaint is that these services all have URLs that have side effects via HTTP GET. This is an interesting distinction to make.

I just set up a new Drupal installation, and I'm reminded of Drupal's cron.php. cron.php runs whatever periodic maintenance tasks are needed. In other words, it changes data. But, you really want to use GET in that case, because it makes it trivial to add a wget crontab entry to ping it periodically.

My own app keeps does housekeeping as links are clicked, which is far easier via a GET than to rig up a POST via JavaScript. Maybe the difference here is whether or not one is making a claim of a RESTful interface. Or maybe the difference is how caught up in the semantics of it one is. Josh Alen has a good comment on this:

people chose between GET and POST based on other critera than suggested in the Fielding paper

I think this is on target. If you're conciously providing an API for the public to use, following the RESTful standards that Dare mentions is worthwhile, because it helps with the principle of least surprise. But, you also need to look at the overall convenience of what you're doing... if you have a good reason to bend the rules, do so and make sure you document it. If it's truly a good reason for rule-bending, it shouldn't really take people by surprise or throw them off.

This makes me think of the general notion that APIs are a user interface for developers. In Swing programming, to add a widget to a window you had to do this:

frame.getContentPane().add(somewidget)

This is the "correct" thing to do, because the JFrame object itself is not actually a container for UI widgets. But, it has a container: the content pane. Correct or not, it was annoying. Java 1.5 now allows you to do this:

frame.add(somewidget)

Though it is less "correct" for the architecture, I think this is more inline with what programmers expect and want to do with the API.

I don't know if this is the case with the Bloglines, Flickr and De.licio.us APIs, but my main point is that there are times when user experience is worth more than "following the spec".

Read: GET, POST, PUT and DELETE in REST

Topic: Spring Web Flow supports continuations, or does it? Previous Topic   Next Topic Topic: Smarter Rich Client JavaOne BOF

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use