37,720
社区成员
发帖
与我相关
我的任务
分享
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Cookies;
my $ua = LWP::UserAgent->new();
my $cookie_jar=HTTP::Cookies->new(file =>"cookie",autosave => 1, ignore_discard => 1);
$ua->cookie_jar($cookie_jar);
my $req = HTTP::Request->new(GET => 'https://wcdma-ll.app.alcatel-lucent.com/livelink/livelink.exe');
$req->authorization_basic($username, $passwd);
my $res = $ua->request($req);
if ($res->is_success)
{
print "Login success.\n";
print $res->as_string;
}
else
{
die "Login failed.\n";
}
print "################## Get File #################\n";
$req = HTTP::Request->new(GET => 'https://wcdma-ll.app.alcatel-lucent.com/livelink/livelink.exe?func=ll&objId=62081897&objAction=download');
$req->authorization_basic($username, $passwd);
$res = $ua->request($req);
print $res->as_string;
$ua->ssl_opts(verify_hostname => 0);
HTTP/1.1 200 OK
Connection: close
Date: Tue, 16 Aug 2011 08:01:45 GMT
Server: Apache/2.2.11 (Win32) mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.8 mod_perl/2.0.3 Perl/v5.8.7
Content-Type: text/html
Expires: -1
Client-Date: Tue, 16 Aug 2011 08:03:41 GMT
Client-Peer: 135.120.57.87:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /DC=com/DC=alcatel/DC=ad/DC=ad2/O=Alcatel Lucent/CN=Alcatel Lucent AD Internal SSL Sub CA
Client-SSL-Cert-Subject: /C=FR/ST=FR/O=Alcatel-Lucent/OU=Alcatel-Lucent/CN=wcdma-ll.app.alcatel-lucent.com
Client-SSL-Cipher: DHE-RSA-AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked
<HTML>
<!-- File: llgettz.html -->
<SCRIPT Language="Javascript1.2">
……