HTTP::...::Basic(3pm)

✨ HTTP::...::Basic ✨

okay so bestie, this page is from the User Contributed Perl Documentation and it's all about HTTP::Headers::ActionPack::Authorization::Basic β€” the Basic Authorization Header. that's the manual name, that's the vibe, we move πŸ’…


πŸŽ€ NAME πŸŽ€

HTTP::Headers::ActionPack::Authorization::Basic β€” The Basic Authorization Header ✨


🌸 VERSION 🌸

version 0.09 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole mood board, literally copy-paste:

use HTTP::Headers::ActionPack::Authorization::Basic;

# create from string
my $auth = HTTP::Headers::ActionPack::Authorization::Basic->new_from_string(
    'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
);

# create from parameters
my $auth = HTTP::Headers::ActionPack::Authorization::Basic->new(
    'Basic' => {
        username => 'Aladdin',
        password => 'open sesame'
    }
);

my $auth = HTTP::Headers::ActionPack::Authorization::Basic->new(
    'Basic' => [ 'Aladdin', 'open sesame' ]
);

my $auth = HTTP::Headers::ActionPack::Authorization::Basic->new(
    'Basic' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
);

the way there are four different ways to build the same thing?? that's not a red flag that's a green flag actually 🌈


πŸ’– DESCRIPTION πŸ’–

so this class represents the Authorization header, but like… hyperfixated on the 'Basic' type specifically. main character energy, one header type only, we stan a specialist πŸ‘‘


πŸ‘‘ METHODS πŸ‘‘

πŸ’… new ( $type, $credentials )

okay so the $credentials argument is giving choose your own adventure, and it can be any one of these three:

  • a Base64 encoded string β€” literally the thing you'd get passed in via the header
  • a HASH ref with username and password keys
  • a two element ARRAY ref where the first element is the username and the second is the password

pick your fighter, they all work 🫢

✨ and then the rest ✨

these are the other methods, listed here exactly as the docs list them, no commentary attached β€” so ngl I'm not about to make stuff up about them πŸ’€

  • new_from_string ( $header_string )
  • auth_type
  • username
  • password
  • as_string

🌟 AUTHOR 🌟

Stevan Little <stevan.little@iinteractive.com> β€” icon, legend, the moment πŸ’œ


🫢 CONTRIBUTORS 🫢

  • Andrew Nelson <anelson@cpan.org>
  • Dave Rolsky <autarch@urth.org>
  • Florian Ragwitz <rafl@debian.org>
  • Jesse Luehrs <doy@tozt.net>
  • Karen Etheridge <ether@cpan.org>

the group chat came THROUGH, fr fr πŸŽ€


This software is copyright (c) 2012 by Infinity Interactive, Inc..

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, free software rights πŸ’–


lowkey reminder bestie: everything above is exactly what the docs say, I just said it with more sparkle ✨

and that's the whole page!! footer era: this was rendered by perl v5.34.0 on 2022-06-14, under the name HTTP::...::Basic(3pm). byeee, go encode something πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from