OAuth:...atters(3pm)

πŸ“¦
version 0.11 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… OAuth::Lite2::Formatters

okay so bestie, this is a page from the User Contributed Perl Documentation, and it lives in section 3pm (that's the Perl module man section, iykyk). The star of the show is OAuth::Lite2::Formatters β€” the OAuth 2.0 formatters store. Yes, a whole little shop of formatters. Let's get into it πŸŽ€


✨ SYNOPSIS ✨

the way you grab one of these is literally two lines, no cap:

my $formatter = OAuth::Lite2::Formatter->get_formatter_by_name("json");
my $formatter = OAuth::Lite2::Formatter->get_formatter_by_type("application/json");

my $obj = $formatter->parse( $string );
$string = $formatter->format( $obj );

like, get your formatter, then parse strings into objects or format objects back into strings. chef's kiss 🀌


🌸 DESCRIPTION 🌸

So this is the OAuth 2.0 formatters store. Here's the tea: starting from draft-v8, the specification only requires the JSON format. Only. One. Format. πŸ’€

But this library keeps the other formatters around anyway, as a lil treat for interop β€” so you can play nice with stuff that isn't strictly spec-compliant. Iconic of it honestly 🫢


πŸ‘‘ METHODS πŸ‘‘

🌈 get_formatter_by_name( $name )

hands you back the formatter that matches by name. cute, simple, by-name energy πŸ’–

πŸ¦‹ get_formatter_by_type( $content_type )

hands you back the formatter that matches by content type. so if you've got a Content-Type lying around, this is your girl ✨


πŸ”₯ SEE ALSO πŸ”₯

go read these next, bestie, they're the whole friend group:

  • OAuth::Lite2::Formatter
  • OAuth::Lite2::Formatter::JSON
  • OAuth::Lite2::Formatter::XML
  • OAuth::Lite2::Formatter::FormURLEncoded

πŸŽ€ AUTHOR πŸŽ€

Lyo Kato, <lyo.kato@gmail.com> β€” the main character who wrote all this πŸ’œ


Copyright (C) 2010 by Lyo Kato

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

fr fr, it's Perl-licensed β€” pick your Perl version, it's giving freedom 🌈

and that's the whole page, bestie! πŸ₯³ this one was rendered by perl v5.36.0 and dated 2023-07-01 β€” go forth and format responsibly πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from