use LWP UserAgent use HTTP Request Common my request REQ message here

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use LWP::UserAgent;
use HTTP::Request::Common;
my $request = << REQ;
# message here
REQ
# client certificate support
$ENV{HTTPS_CERT_FILE} = 'test.crt';
$ENV{HTTPS_KEY_FILE} = 'test.key';
# CA cert peer verification
$ENV{HTTPS_CA_FILE} = 'ca.crt';
my $ua = new LWP::UserAgent;
my $res = $ua->request(POST 'https://test.com',
SOAPAction => 'http://test.com/operationA',
Content_Type => 'application/xml',
Content => $request);
print $res->code."\n";
print $res->content."\n";
print "Work is done. \n\n";