要从 API 获得响应,密钥必须与请求一起作为标头发送。如果我使用请求从命令行发送它成功。但是,如果我使用curl -Ss -H "APIKEY: KEY" https://www.example.com/some/stuff
my $path = "https://www.example.com/some/stuff"
my $mech = WWW::Mechanize->new();
$mech->add_header('APIKEY'=>'KEY');
$mech->get($path);
我收到。如何正确提供此标头以便进行身份验证?Error GETing https://www.example.com/some/stuff: Can't connect to www.example.com:443 (Permission denied)