in reply to Re^2: Not sure how to use HTTP::Tiny
in thread Not sure how to use HTTP::Tiny

once when i was forced to do authorization myself (via tkx sockets) i used

if ($args{user} || $args{password}) { use MIME::Base64; $tkxf_auth='Authorization: Basic '.encode_base64($args{user}.':' +.$args{password},''); }
which would make your call
use MIME::Base64; my $headers = { Accept => "application/json", 'Content-Type' => "application/json", Authorization => 'Authorization: Basic '.encode_base +64($args{user}.':'.$args{password},'') };

Edit: the real userid/passwords are stored in the hash %args under keys userid and password!

Replies are listed 'Best First'.
Re^4: Not sure how to use HTTP::Tiny
by plx (Initiate) on May 21, 2018 at 19:57 UTC
    I get the same result (401) with my $headers = { Accept => "application/json", 'Content-Type' => "application/json", Authorization => "Authorization: Basic ".encode_base +64("user:password") };

      Try

      use MIME::Base64; my $headers = { Accept => "application/json", 'Content-Type' => "application/json", Authorization => "Basic ".encode_base64("user:password"), };
      poj

        i was building the whole raw line in my tkx code, and i kinda forgot what the key part would do for me in the header section, sorry