Commit | Line | Data |
---|---|---|
7656dd12 | 1 | package Test::Catalyst::Action::REST::Controller::Actions; |
930013e6 | 2 | use Moose; |
3 | use namespace::autoclean; | |
7656dd12 | 4 | |
930013e6 | 5 | BEGIN { extends qw/Catalyst::Controller::REST/ } |
7656dd12 | 6 | |
5f461845 | 7 | __PACKAGE__->_action_class('Test::Action::Class'); |
7656dd12 | 8 | |
9 | sub begin {} # Don't need serialization.. | |
10 | ||
5f461845 | 11 | sub test : Local : ActionClass('+Catalyst::Action::REST') { |
7656dd12 | 12 | my ( $self, $c ) = @_; |
5f461845 | 13 | $c->res->header('X-Was-In-TopLevel', 1); |
7656dd12 | 14 | } |
15 | ||
5f461845 | 16 | sub test_GET : Private { |
7656dd12 | 17 | my ( $self, $c ) = @_; |
5f461845 | 18 | $c->res->body('GET'); |
7656dd12 | 19 | } |
20 | ||
5f461845 | 21 | sub test_POST : Action { |
7656dd12 | 22 | my ( $self, $c ) = @_; |
5f461845 | 23 | $c->res->body('POST'); |
7656dd12 | 24 | } |
25 | ||
5213846d | 26 | sub test_PUT :ActionClass('+Test::Action::Class::Sub') { |
7656dd12 | 27 | my ( $self, $c ) = @_; |
5f461845 | 28 | $c->res->body('PUT'); |
7656dd12 | 29 | } |
30 | ||
5f461845 | 31 | sub test_DELETE : Local { |
7656dd12 | 32 | my ( $self, $c ) = @_; |
5f461845 | 33 | $c->res->body('DELETE'); |
7656dd12 | 34 | } |
35 | ||
5f461845 | 36 | sub test_OPTIONS : Path('foobar') { |
7656dd12 | 37 | my ( $self, $c ) = @_; |
38 | ||
5f461845 | 39 | $c->res->body('OPTIONS'); |
7656dd12 | 40 | } |
41 | ||
42 | sub end : Private {} # Don't need serialization.. | |
43 | ||
44 | 1; | |
45 |