Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl LWP::Protocol::https未安装(如何安装?)_Perl_Lwp - Fatal编程技术网

Perl LWP::Protocol::https未安装(如何安装?)

Perl LWP::Protocol::https未安装(如何安装?),perl,lwp,Perl,Lwp,有人能帮我吗?我创建了一个Perl脚本来运行https任务。当我运行它时,我得到错误LWP::Protocol::https not installed 我不知道,也找不到关于如何准确安装LWP::Protocol::http的教程或命令。有人知道怎么安装吗?安装LWP相当容易 我已经安装了LWP和Crypt SSLeay,但是我仍然收到错误。这是我的密码: use LWP::UserAgent; my $ua = LWP::UserAgent->new; # set custom

有人能帮我吗?我创建了一个Perl脚本来运行https任务。当我运行它时,我得到错误LWP::Protocol::https not installed

我不知道,也找不到关于如何准确安装LWP::Protocol::http的教程或命令。有人知道怎么安装吗?安装LWP相当容易

我已经安装了LWP和Crypt SSLeay,但是我仍然收到错误。这是我的密码:

use LWP::UserAgent;

my $ua = LWP::UserAgent->new;


# set custom HTTP request header fields

my $req = HTTP::Request->new(PUT => "https://thesite.com");

$req->header('Authorization' => 'myauth');
$req->header('Accept' => 'JSON:Application/JSON');
$req->header('Content-Type' => 'JSON:Application/JSON');
$req->header('Host' => 'api.thesite.com');

$req->content('Text' => 'thetext');



my $resp = $ua->request($req);
if ($resp->is_success) {
    my $message = $resp->decoded_content;
    print "Received reply: $message\n";
}
else {
    print "HTTP POST error code: ", $resp->code, "\n";
    print "HTTP POST error message: ", $resp->message, "\n";
}

谢谢你的帮助

运行
sudo cpan install LWP::Protocol::https
为我修复了此问题。

sudo yum install perl LWP Protocol https
为我修复了问题。

如果错误告诉您
LWP::Protocol::https
未安装,请安装它。哦,天哪。这是糟糕的一天。我需要编辑这个问题。我忙得不可开交,我没有做正确的事…
cpan
然后
安装LWP::Protocol::https
安装Bundle::LWP
看:伙计,我想我试过了。好的,很好。现在正在安装。非常感谢您的快速帮助
sudoperl-MCPAN-we'install“LWP::Protocol::https”
不起作用,因为某些测试失败,并且您的命令起作用。非常感谢你!