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

Re: Need help with my code?

Thread Previous | Thread Next
From:
Cormac Garvey
Date:
March 16, 2001 09:58
Subject:
Re: Need help with my code?
Message ID:
200103161757.LAA02225@syseng.hstc.necsyl.com
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!


Thread Previous | 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