Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Not sure how to use HTTP::Tiny

by huck (Parson)
on May 21, 2018 at 18:18 UTC ( #1214998=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1214998]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2018-12-18 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (79 votes). Check out past polls.

    Notices?