Perl REST client, authentication issue
问题 I am using Perl 5.16 with REST::Client for REST call with GET, but it shows an error 401 authentication issue. I am not clear how to resolve this issue. Code use REST::Client; use JSON; use Data::Dumper; use MIME::Base64; my $username = 'test'; my $password = 'test'; my $client = REST::Client->new(); $client->setHost('http://myurl'); my $headers = { Accept => 'application/json', Authorization => 'Full' . encode_base64($username . ':' . $password) }; $client->GET('folder/file', $headers);