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!