users@jersey.java.net

[Jersey] Implement rest interface through browser

From: John Lister <john.lister_at_kickstone.com>
Date: Wed, 06 Apr 2011 08:41:10 +0100

Hi, just been following the thread about restful methods of calling an
sproc, and got me thinking. I'd be grateful for your opinions on this
question:

What is the best way to offer a restful interface accessable by a web
browser and also automated clients?

For example say I want to add a resource, the restful way is to use PUT,
which I have no problem with, but say I want to allow that from a html
page which only offer GET/POST for form actions. How would you work
around this, the alternatives seem to be:
- ignore put and just use POST
- implement both and have POST determine the correct action based on a
parameter
- use client side (ajax style) scripting to make a PUT call and process
the result

How would you do it?

Thanks

John