logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

HTTP::Headers::ActionPack::Authorization::Basic - The Basic Authorization Header

Author

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>

Description

       This class represents the Authorization header with the specific focus on the 'Basic' type.

Methods

       "new ( $type, $credentials )"
           The  $credentials  argument  can  either  be  a  Base64 encoded string (as would be passed in via the
           header), a HASH ref with username and password keys, or a two  element  ARRAY  ref  where  the  first
           element is the username and the second the password.

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

Name

       HTTP::Headers::ActionPack::Authorization::Basic - The Basic Authorization Header

Synopsis

         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=='
         );

Version

       version 0.09

See Also