Commit | Line | Data |
---|---|---|
7ad87df9 | 1 | package SampleREST::Controller::Monkey; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | use base 'Catalyst::Controller::REST'; | |
6 | ||
7 | sub myindex :Path :Args(0) :ActionClass('REST') {} | |
8 | ||
9 | sub myindex_GET { | |
10 | my ( $self, $c, $rdata ) = @_; | |
11 | ||
12 | $c->stash->{'rest'} = { | |
13 | 'monkey' => 'likes chicken!', | |
14 | }; | |
15 | } | |
16 | ||
17 | sub myindex_POST { | |
18 | my ( $self, $c, $rdata ) = @_; | |
19 | ||
20 | $c->stash->{'rest'} = $c->request->data; | |
21 | } | |
22 | ||
23 | 1; |