1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use WWW::Mechanize;
use Crypt::SSLeay;
my $url = "https://poms-test.ts.fujitsu.com/CallLog/";
my $mech = WWW::Mechanize->new( autocheck => 1 ); # initalize
#$mech->credentials("username", "password");
$mech->credentials('poms-test.ts.fujitsu.com:80', 'POMS2 HTTP Interface Login', 'username', 'password');
#my $content = $mech->get($url); # get content of url
my $response = $mech->post('https://poms-test.ts.fujitsu.com/CallLog',
[
msg_node => 'meinKnoten',
]);
if ($response->is_success) {
print "\n\nis success (content):", $response->content, "\n\n";
}
else {
print "\n\nis not success (status_line): ", $response->status_line, "\n\n";
# print "\n\nis not success (content):", $response->content, "\n\n";
}
print "url:'$url'\ncontent:'$response'\n";
exit;
Error POSTing https://poms-test.ts.fujitsu.com/CallLog: Unauthorized at D:\test\mechanize_https.pl line 12