Commit | Line | Data |
c5c27d42 |
1 | package Test::Catalyst::Action::REST::Controller::Deserialize; |
930013e6 |
2 | use Moose; |
3 | use namespace::autoclean; |
ffb4cc71 |
4 | |
930013e6 |
5 | BEGIN { extends 'Catalyst::Controller' } |
ffb4cc71 |
6 | |
7 | __PACKAGE__->config( |
588cbecc |
8 | 'action_args' => { |
9 | 'test_action_args' => { |
10 | 'deserialize_http_methods' => [qw(POST PUT OPTIONS DELETE GET)] |
11 | } |
12 | }, |
ffb4cc71 |
13 | 'stash_key' => 'rest', |
14 | 'map' => { |
15 | 'text/x-yaml' => 'YAML', |
16 | 'text/x-data-dumper' => [ 'Data::Serializer', 'Data::Dumper' ], |
17 | 'text/broken' => 'Broken', |
18 | }, |
19 | ); |
20 | |
21 | |
22 | sub test :Local :ActionClass('Deserialize') { |
23 | my ( $self, $c ) = @_; |
24 | $c->res->output($c->req->data->{'kitty'}); |
25 | } |
26 | |
588cbecc |
27 | sub test_action_args :Local :ActionClass('Deserialize') { |
28 | my ( $self, $c ) = @_; |
29 | $c->res->output($c->req->data->{'kitty'}); |
30 | } |
31 | |
ffb4cc71 |
32 | 1; |