Dancer2::Serializer::CBOR - CBOR serializer for Dancer2
version 0.000002
package MyApp::API::CBOR; use Dancer2; set serializer => 'CBOR'; get '/view/user/:id' => sub { my $id = params->{'id'}; return { user => get_id($id) }; };
This serializer allows to serialize and deserialize automatically the CBOR (Concise Binary Object Representation) structure.
It requires CBOR::XS.
Serialize a Perl data structure to a CBOR structure.
Deserialize a CBOR structure to a Perl data structure.
application/cbor.
application/cbor
The test is based on code David Zurborg has written.
CBOR::XS
RFC7049
Sawyer X <xsawyerx@cpan.org>
This software is copyright (c) 2014 by Sawyer X.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dancer2::Serializer::CBOR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2::Serializer::CBOR
CPAN shell
perl -MCPAN -e shell install Dancer2::Serializer::CBOR
For more information on module installation, please visit the detailed CPAN module installation guide.