Perl LWP::Protocol::https未安装(如何安装?)
有人能帮我吗?我创建了一个Perl脚本来运行https任务。当我运行它时,我得到错误LWP::Protocol::https not installed 我不知道,也找不到关于如何准确安装LWP::Protocol::http的教程或命令。有人知道怎么安装吗?安装LWP相当容易 我已经安装了LWP和Crypt SSLeay,但是我仍然收到错误。这是我的密码: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
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”
不起作用,因为某些测试失败,并且您的命令起作用。非常感谢你!