develooper Front page | perl.libwww | Postings from November 2001

lwp-request https

Thread Next
From:
Feng, James
Date:
November 6, 2001 05:06
Subject:
lwp-request https
Message ID:
FA17F510D6163644B6A35EEE38D5EFC33A7134@COVMAIL007.covisint.com
Hi There,

I used lwp to get a https site and I got " an error Error:500 read
failed:". According to the error code 500, it is a internal server error
however I can get the site by using browser. I have Crypt::SSLeay
installed. Here is my code and please help. Thanks in advance.

sub Obj_lwp_https
{
        my ($curl) = @_;

        use LWP::UserAgent;

        my $ua = new LWP::UserAgent;

        $ua -> agent("$0/0.1 " . $ua->agent);

	my $req = new HTTP::Request 'GET' => $curl;

        $req -> header('Accept' => 'text/html');

        my $res = $ua->request($req);

        if ($res->is_success)
        {
                return $res->content;
        }
        else
        {
                return "Error:" . $res->status_line . "\n";
        }
}


James Feng
Covisint
e-mail: jfeng@covisint.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About