Dancer...alizer(3pm)
π NAME π
Dancer::Serializer β the serializer wrapper for Dancer, bestie. That's literally it, that's the whole name. Also hi, this is the 3pm page in case you were wondering where you wandered into π¦
β¨ VERSION β¨
version 1.3522 β that's the one we're on, no cap.
πΈ DESCRIPTION πΈ
Okay so likeβ¦ this module is the wrapper. The wrapper. Its whole job is holding space for all the different serializers so they can do their thing. It's giving backstage mom energy for serialization. π
π«Ά USAGE π«Ά
π Configuration π
There's this config variable called serializer, and it's the one that tells Dancer which serializer to use when it deserializes your request and serializes your response. Main character variable, honestly.
You can change it in your config.yml file like this:
serializer: "YAML"
Or you can do it right in your application code:
# setting JSON as the default serializer
set serializer => 'JSON';
In your routes, you can access parameters just like any other route β nothing weird, nothing extra, it just works. β¨
And here's the cute part: when you return a Perl data structure from inside a route, it gets serialized automatically into whatever engine you picked (for instance, "JSON"). Like, it just does it. You don't have to lift a finger. π
For PUT and POST methods, you can grab request->body as a string, and you can unserialize it yourself if you really, truly need to. But lowkey β if your content type is recognized by the serializer, request->body gets unserialized automatically and shows up as a standard parameter. Free. No effort. Iconic.
So for instance, if you call
curl -X POST -H 'Content-Type: application/json' -d '{"id":"bar"}' /foo
then your foo route can do something like:
post "/foo" => {
my $id = param('id'); # gets "bar"
# ...
}
See? param('id') just hands you "bar". Chef's kiss. π₯
π AUTHORS π
This module has been written by Alexis Sukrieh and Franck Cuny. See the AUTHORS file that comes with this distribution for details.
π LICENSE π
This module is free software and is released under the same terms as Perl itself. Periodt. π
β SEE ALSO β
- See
Dancerfor details about the complete framework. Go look, it's the whole vibe. π¦
π AUTHOR π
Dancer Core Developers
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2010 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
okay that's the whole page, mwah π β this was Dancer::Serializer from perl v5.40.1, dated 2026-05-05, and yeah, the header and footer both say Dancer...alizer(3pm) because apparently truncation is the vibe around here πΈ go forth and serialize, bestie π«Ά
π¦ where this page comes from
- ubuntu stonking: libdancer-perl 1.3522-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms