users@jersey.java.net

[Jersey] Re: Implement rest interface through browser

From: Cameron Heavon-Jones <cmhjones_at_gmail.com>
Date: Wed, 6 Apr 2011 11:46:57 +0100

Hi John,

Allowing forms to use PUT and DELETE is currently being discuss by the HTML WG and will hopefully make it into the final specification. Until then any of the work arounds you suggest will work.

My personal preference is to use client-side scripting to fix a client-side implementation problem. To update the forms when additional methods are supported should only require removing the workaround.

cam


On 06/04/2011, at 9:43 AM, Tauren Mills wrote:

> Of course it depends on your use case, but in my situation I use client side scripting to make the PUT call.
>
> I've found the Backbone.JS framework to make doing REST from javascript clients quite good:
> http://documentcloud.github.com/backbone
>
> Tauren
>
>
>
> On Wed, Apr 6, 2011 at 12:41 AM, John Lister <john.lister_at_kickstone.com> wrote:
> 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
>