seanbo has asked for the wisdom of the Perl Monks concerning the following question:
Here is the output#!/usr/bin/perl -w use strict; use LWP::UserAgent; use LWP::Protocol::https; use URI::URL; my %parm = ( url => 'https://XXX.XXX.XXX.XXX', uatimeout => 120, browser => 'IE/5.0', username => 'XXXXX', password => 'XXXXX', realm => 'XXXXX', ); my $netloc = new URI::URL($parm{'url'})->netloc(); my $ua = new LWP::UserAgent; $ua->agent($parm{'browser'}); $ua->timeout($parm{'timeout'}); $ua->credentials($netloc, $parm{'realm'}, $parm{'username'}, $parm{'password'}); my $request = new HTTP::Request POST=> $parm{'url'}; $request->authorization_basic($parm{'username'}, $parm{'password'}); my $page = $ua->request($request); #print $request->as_string(); if ($page->is_success) { print "Redirect\n"; print $page->content; } elsif ($page->is_redirect) { print $page->content; } else { print $page->error_as_HTML; print $page->content; }
C:\TEMP>perl -w bcbs.pl Redirect <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>302 Found</TITLE> </HEAD><BODY> <H1>Found</H1> The document has moved <A HREF="https://XXX.XXX.XXX.XXX:443/?&STCO +=1O3AEz6wYA2QAACjwXZg&STCOEND">here</A>.<P> <P>Additionally, a 302 Found error was encountered while trying to use an ErrorDocument to handle t +he request . </BODY></HTML>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP, SSL, 302
by seanbo (Chaplain) on Aug 07, 2001 at 20:42 UTC | |
by rucker (Scribe) on Aug 08, 2001 at 02:52 UTC | |
by seanbo (Chaplain) on Aug 08, 2001 at 17:09 UTC | |
|
Re: LWP, SSL, 302
by mitd (Curate) on Aug 08, 2001 at 02:49 UTC | |
by blakem (Monsignor) on Aug 08, 2001 at 03:40 UTC | |
by seanbo (Chaplain) on Aug 08, 2001 at 18:10 UTC | |
by seanbo (Chaplain) on Aug 08, 2001 at 22:08 UTC | |
by seanbo (Chaplain) on Aug 08, 2001 at 17:34 UTC |