如何通过代理使用Perl JIRA::Client::Automated模块连接到HTTPS服务器?

如何通过代理使用Perl JIRA::Client::Automated模块连接到HTTPS服务器?,perl,jira,cpan,jira-rest-api,Perl,Jira,Cpan,Jira Rest Api,我不熟悉使用JIRA和REST API。请告诉我如何使用JIRA::Client::Automated module连接到HTTPS JIRA服务器。我正在尝试使用下面的代码连接到jira服务器 use strict; use warnings use JIRA::Client::Automated; my $user = 'foo'; my $pass = 'bar'; my $url = 'https://xxx.yyy'; my $jira = JIRA::Client::Automa

我不熟悉使用JIRA和REST API。请告诉我如何使用JIRA::Client::Automated module连接到HTTPS JIRA服务器。我正在尝试使用下面的代码连接到jira服务器

use strict;
use warnings
use JIRA::Client::Automated;

my $user = 'foo';
my $pass = 'bar';
my $url = 'https://xxx.yyy';

my $jira = JIRA::Client::Automated->new($url, $user, $pass);
但是使用上面的代码总是给我一个500错误,说无法连接。由于我正在尝试从本地计算机进行连接,因此请求不会通过本地系统代理进行。请让我知道如何通过代理连接

谢谢你的建议,丹尼尔。 我已经按照您的建议编辑了代码

use strict;
use warnings
use JIRA::Client::Automated;

my $user = 'foo';
my $pass = 'bar';
my $url = 'https://xxx.yyy.com/jira-stage/';

my $jira = JIRA::Client::Automated->new($url, $user, $pass);
my $ua = $jira->ua();
$ua->proxy('http', 'http://proxy.com:8000');
$search_results = $jira->search_issues(project in (sample), 0, 1000);
my $count = $search_results->{'total'};
print "$count";

但仍然面临同样的问题。请建议。

查看的文档。您可以从中获取LWP::UserAgent对象:

my $ua = $jira->ua;
根据的文档,您可以如下设置代理

$ua->proxy('https', 'https://proxy:8080/');
或者通过以下方式从各自的环境变量加载代理设置:

$ua->env_proxy;