1 package Test::Catalyst::Action::REST::Controller::Root;
3 use namespace::autoclean;
5 BEGIN { extends qw/Catalyst::Controller::REST/ }
7 __PACKAGE__->config( namespace => '' );
9 sub begin {} # Don't need serialization..
11 sub test : Local : ActionClass('REST') {
12 my ( $self, $c ) = @_;
13 $c->stash->{'entity'} = 'something';
17 my ( $self, $c ) = @_;
19 $c->stash->{'entity'} .= " GET";
24 my ( $self, $c ) = @_;
26 $c->stash->{'entity'} .= " POST";
31 my ( $self, $c ) = @_;
33 $c->stash->{'entity'} .= " PUT";
38 my ( $self, $c ) = @_;
40 $c->stash->{'entity'} .= " DELETE";
45 my ( $self, $c ) = @_;
47 $c->stash->{'entity'} .= " OPTIONS";
51 sub notreally : Local : ActionClass('REST') {
55 my ( $self, $c ) = @_;
57 $c->stash->{'entity'} = "notreally GET";
61 sub not_implemented : Local : ActionClass('REST') {
64 sub not_implemented_GET {
65 my ( $self, $c ) = @_;
67 $c->stash->{'entity'} = "not_implemented GET";
71 sub not_implemented_not_implemented {
72 my ( $self, $c ) = @_;
74 $c->stash->{'entity'} = "Not Implemented Handler";
78 sub not_modified : Local : ActionClass('REST') { }
80 sub not_modified_GET {
81 my ( $self, $c ) = @_;
87 my ( $self, $c ) = @_;
89 $c->res->content_type('text/plain');
90 $c->res->body( $c->stash->{'entity'} );
93 sub end : Private {} # Don't need serialization..