(2019-08-23)
Problem
How do I generate a Basic Authorization header for use in my html?
Solution
$ echo -n myuser:mypassword | base64
bXl1c2VyOm15cGFzc3dvcmQ=
Implemented as so:
my $http = HTTP::Tiny->new(
default_headers => {
Authorization => 'Basic bXl1c2VyOm15cGFzc3dvcmQ=',
}
);
Commentary
There's probably some magic where I can just generate this shit automatically, but my google-fu is weak and I can't find such a thing.