任何人都可以提供帮助。我收到那个错误
错误:没有为方案 https 配置后端
my $http = HTTP::Tinyish->new();
my $res = $http->post("https://api.sandbox.paypal.com/v1/oauth2/token/", {
headers => { 'username' => 'client_id',
'password' => 'screte',
'grant_type' => 'client_credentials'}
});
$http->get("https://api.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI", {
headers => { 'Content-Type' => 'application/json' },
});
if ( $res->{'is_success'} ) {
print Dumper( decode_json $res->{'content'} );
} else {
print "$res->{'status'} $res->{'reason'}\n";
}
Run Code Online (Sandbox Code Playgroud)
HTTP::Tinyish是HTTP::Tiny、libwww-perl 和命令行工具的前端,curl以及wget. 它根据 URL 方案选择一个可用的。
这两个 Perl 模块不支持开箱即用的 TLS。因此,我的猜测是您既没有也curl没有wget安装,并且您的 libwww-perl 不支持 TLS。
所以,你可以通过安装来解决您的问题curl,LWP::Protocol::https或两者兼而有之。
| 归档时间: |
|
| 查看次数: |
386 次 |
| 最近记录: |