Catalyst::View::REST::Data::Serializer - Data::Serializer View Class
# lib/MyApp/View/REST.pm package MyApp::View::REST; use base 'Catalyst::View::REST::Data::Serializer'; 1; $c->forward('MyApp::View::REST');
This is the Data::Serializer view class. It can be used to use any number of Serialization methods (YAML, Storable, Data::Dumper) to implement a REST view. It also supports optional compression, encryption, and a host of other useful goodies.
Data::Serializer
Any of the options you can pass to Data::Serializer you can put into $c->config->{'serializer'}, and have them passed on to it. If you don't pass any options, the following are used:
serializer => 'Data::Dumper', digester => 'SHA1', cipher => 'Blowfish', secret => undef, portable => '1', compress => '0', serializer_token => '1', options => {},
They are the same as the Data::Serializer defaults. The two additional options are:
Setting this to a true value will allow you to pass the "astext=1" param to any request processed by this View. The results will be the contents of $c->stash passed through to Data::Dumper, as opposed to your Serialized object.
This should be turned off in production environments concerned about security. It's great for debugging, though!
Setting this to a true value will cause Data::Serializer to call the "raw" version of the regular serialize function (raw_serialize). The effect is the same as just using the underlying Serializer directly.
Serializes $c->stash to $c->response->output. If you pass "astext=1" as a param, and the $c->config->{'serializer'}->{'astext'} option is true, then it will return the output of the stash via Data::Dumper.
Catalyst, Data::Serializer
Adam Jacob, adam@stalecoffee.org
adam@stalecoffee.org
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::View::REST::Data::Serializer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::REST::Data::Serializer
CPAN shell
perl -MCPAN -e shell install Catalyst::View::REST::Data::Serializer
For more information on module installation, please visit the detailed CPAN module installation guide.