Apache2::REST::Handler::test::user - Test dummy user handler


Apache2-REST documentation Contained in the Apache2-REST distribution.

Index


Code Index:

NAME

Top

Apache2::REST::Handler::test::user - Test dummy user handler

GET

Echoes a message.

isAuth

Allows GET


Apache2-REST documentation Contained in the Apache2-REST distribution.
package  Apache2::REST::Handler::test::user ;

use base qw/Apache2::REST::Handler/  ;

sub GET{
    my ( $self , $req , $resp ) = @_ ;
    
    $resp->data()->{'user_message'} = 'You are accessing user '.$self->userid() ;
    $resp->data()->{'user'} = {
        'name' => "\x{111}\x{103}ng t\x{1ea3}i t\x{1ea1}i",
        'email' => 'jerome@eteve.net' ,
    };
    return Apache2::Const::HTTP_OK ;
}

sub isAuth{
    my ( $self , $method , $req ) = @_ ;
    
    ## if not no auth token
    return $method eq 'GET' ;
    
}




1;