inblosam has asked for the wisdom of the Perl Monks concerning the following question:
So, if the problem is the redirect to an https, how do I resolve that? Here is my script:501 (Not Implemented) Protocol scheme 'https' is not supported Client- +Date: Fri, 24 May 2002 16:56:33 GMT
#!/usr/lib/perl use strict; use warnings; use LWP::UserAgent; use HTTP::Request::Common; use HTTP::Cookies; use LWP::Simple; #need to get sessionid so it is nice and new my $page = get 'http://www.sitedomain.com/Login.jsp'; $page =~ /jid=(\w+)/; my $jid = $1; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => 'cookie_jar', autosave =>1) +); push @{ $ua->requests_redirectable }, 'POST'; my $request = $ua->request(POST "http://www.sitedomain.com/Login.jsp", { username => 'abc123', password => '123abc', 'Submit' => 'Sign in', }); print $request->is_success ? "worked\n" : "failed\n"; print $b = $request->as_string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(wil) Re: LWP- post to HTTP then redirects to HTTPS (501 error)
by wil (Priest) on May 24, 2002 at 18:19 UTC | |
by inblosam (Monk) on May 24, 2002 at 23:37 UTC |