Subject: | request for DELETE support |
Hi, my name is James Robson. I was recently trying to coerce a .cgi
Show quoted text
> script to behave in a RESTful way, and was successful with
> GET|POST|PUT. However, on DELETE I got no parameters. I did some
> snooping and figured out that DELETE isn't really handled by CGI.pm.
>
> I think DELETE would generally be called the same was as GET so I made
> the following modification to CGI.pm on my machine, and DELETE works
> fine. Any reason why CGI.pm couldn't/shouldn't do this? Thanks, James
>
>
> --- /usr/local/share/perl/5.10.0/CGI.pm.bak 2009-11-05
> 15:26:07.000000000 -0700
> +++ /usr/local/share/perl/5.10.0/CGI.pm 2009-11-05 15:23:05.000000000
-0700
Show quoted text> @@ -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 {