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>
In reply to LWP, SSL, 302 by seanbo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |