in reply to A RESTful API framework

Could you give examples of how to implement PUT and DELETE requests? Thanks.

Replies are listed 'Best First'.
Re^2: A RESTful API framework
by jeteve (Pilgrim) on Nov 10, 2009 at 10:17 UTC
    Sure, it's exactly like implementing GET,

    In your subclass of Apache2::REST::Handler, just implement DELETE or PUT:

    sub PUT{ my ( $self , $req , $resp ) = @_; .. Do put something in this resource .. .. Fill resp if necessary .. .. Return the appropriate http code if( $somethingWentWrong ){ return Apache2::Const::HTTP_BAD_REQUEST ; } # else it's ok return Apache2::Const::HTTP_OK ; }