perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Prime <adam.pr...@utoronto.ca>
Subject Re: PUT handler
Date Fri, 24 Apr 2009 15:12:57 GMT
André Warnier wrote:
> Thanks.
> Do you happen to know /where/ in the on-line mod_perl docs there is 
> information about handling a PUT request.
> (I found a nice article in German on the web, here :
> http://www.farid-hajji.net/books/de/Hajji_Farid/pbv2/ew/cgi-upload.html
> )
> Searching for "+mod_perl +"put handler" gives some interesting 
> historical material..

I don't think i've ever seen anything about PUT requests directly, but 
i'd imagine you'd just do something like (completely untested):

sub handler :method {
     my ($self,$r) = @_;
     if ($r->method eq 'PUT') {
         return $self->handle_put($r);
     }
     return DECLINED; #or whatever
}

sub handle_put {
     my ($self,$r) = @_;

     # read the content with $r->read and the content-length header

     # do whatever you want to do with the content of the put request.

     return OK;
}

Using a handler anyway.

Adam

Mime
View raw message