Re: Need help with my code?
Cormac Garvey (a10coga@hstc.necsyl.com)
Fri, 16 Mar 2001 11:57:39 -0600 (CST)
Hi,
Thanks for all your help regarding my "redirection" problems with POST.
I have run into another problem, the page I retrieved uses FRAMES, so
all I see is
<frame src="
/ftgw/webxpress/account_listings/1BD900013E21"
" name="body" marginwidth=0 marginheight=0 scrolling=auto>
I am using libwww 5.50, how can I see file
"/ftgw/webxpress/account_listings/1BD900013E21" ?
Thanks,
Cormac.
>To: "Dave Faraldo" <dfaraldo@nocpulse.com>
>Cc: "Eric J. Schwertfeger" <ejs@bfd.com>, Cormac Garvey
<a10coga@hstc.necsyl.com>, libwww@perl.org
>Subject: Re: Need help with my code?
>From: merlyn@stonehenge.com (Randal L. Schwartz)
>Date: 15 Mar 2001 18:12:58 -0800
>User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3
>MIME-Version: 1.0
>
>>>>>> "Dave" == Dave Faraldo <dfaraldo@nocpulse.com> writes:
>
>Dave> Yup, you got it. Override LWP::UserAgent::redirect_ok with the
>Dave> following, and you should be golden:
>
>Dave> # Overloaded function to allow GET redirects following POSTs
>Dave> sub redirect_ok {
>Dave> my ($ua, $req) = @_;
>
>Dave> if (uc($req->method()) eq 'GET') {
>
>Dave> # Allow redirects on GET requests;
>Dave> return 1;
>
>Dave> } else {
>
>Dave> # Allow GET redirects from POSTs
>Dave> $req->method('GET');
>Dave> return 1;
>Dave> }
>
>Dave> }
>
>Of course, overriding really only makes sense if you think someone
>else in the same program needs the documented behavior. I found it
>much easier to just do this:
>
> use LWP::UserAgent;
> BEGIN { *LWP::UserAgent::redirect_ok = sub { 1 } }
>
>Don't subclass. Patch.
>
>But then, I'm perverse. :)
>
>--
>Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
><merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
>Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
>See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!