Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: REST Webservices

by rhesa (Vicar)
on Apr 12, 2007 at 12:53 UTC ( #609650=note: print w/replies, xml ) Need Help??

in reply to Re^2: REST Webservices
in thread REST Webservices and

Thanks for digging deeper. I didn't have a need for PUT or DELETE yet (but I reckon I will in the future), so I hadn't realised the support was this limited.

I agree that a patch to CGI is in order. Even if most web browsers don't support them, PUT and DELETE are still valid HTTP verbs, and I feel that the various CGI modules ought to support them.

At first blush, a patch to either CGI or CGI::Simple doesn't look so difficult. I think DELETE could be handled pretty much the same way as GET, and PUT is pretty similar to POST. I may be overly optimistic, but it shouldn't take more than changing a couple of if()s ;-)

Replies are listed 'Best First'.
Re^4: REST Webservices
by arbingersys (Pilgrim) on Nov 20, 2009 at 22:05 UTC
    As I make this post, CGI is at version 3.48, and it will handle GET|POST|PUT but not DELETE.

    I discovered this trying to make a REST dispatch in a .cgi script. I believe you're right -- that DELETE can be handled just like GET. On my system, I made the following change to, and DELETE started to work (I got query string parameters back).

    --- /usr/local/share/perl/5.10.0/ 2009-11-05 15:26:07.00 +0000000 -0700 +++ /usr/local/share/perl/5.10.0/ 2009-11-05 15:23:05.000000000 +-0700 @@ -649,7 +649,7 @@ sub init { # If method is GET or HEAD, fetch the query from # the environment. - if ($is_xforms || $meth=~/^(GET|HEAD)$/) { + if ($is_xforms || $meth=~/^(GET|HEAD|DELETE)$/) { if ($MOD_PERL) { $query_string = $self->r->args; } else {

    This is a pretty minor modification, and you get decent functionality out of the DELETE verb (i.e. parameters). I'd love to see at least this much provided by

    A blog among millions.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://609650]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-05-23 19:30 GMT
Find Nodes?
    Voting Booth?