Newsgroups: comp.lang.perl.misc
From: John Bokma <j...@castleamber.com>
Date: 16 Aug 2005 18:05:50 GMT
Local: Tues, Aug 16 2005 2:05 pm
Subject: LWP gives 302 Found after update?
The following script used to work (Logs in to a PHPbb message board):
use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new(); my $response = $ua->post( "http://toxicice.com/login.php", [ username => 'xxxxxxx', With an invalid username/password (as above), it gives: LWP::UserAgent::new: () ... snipped ... LWP::Protocol::collect: read 188 bytes However, with a valid one it gives: LWP::UserAgent::new: () $response->content is empty (''). I updated some time ago to a more recent version of ActiveState Perl, perl -v query * (Complete script is at: ( If you want to test but have no PHP board, mail: phpbb at johnbokma -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: comp.lang.perl.misc
From: Brian Wakem <n...@email.com>
Date: Tue, 16 Aug 2005 19:43:37 +0100
Local: Tues, Aug 16 2005 2:43 pm
Subject: Re: LWP gives 302 Found after update?
John Bokma wrote: The page is printing a Location: header, which tells the browser to go > Login failed: 302 Found > $response->content is empty (''). somewhere else. LWP::UserAgent does not follow this by default for POSTs. Add this:- push @{ $ua->requests_redirectable }, 'POST'; -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: comp.lang.perl.misc
From: John Bokma <j...@castleamber.com>
Date: 16 Aug 2005 18:50:52 GMT
Local: Tues, Aug 16 2005 2:50 pm
Subject: Re: LWP gives 302 Found after update?
Brian Wakem <n...@email.com> wrote: Aargh, it was even in the manual :-( Many thanks, it fixed my script. I > John Bokma wrote: >> Login failed: 302 Found >> $response->content is empty (''). > The page is printing a Location: header, which tells the browser to go > Add this:- > push @{ $ua->requests_redirectable }, 'POST'; have no idea however, why it started to fail in the first place. Was POST removed from the list recently? (I can't remember I updated PHPbb recently). -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: comp.lang.perl.misc
From: Brian Wakem <n...@email.com>
Date: Tue, 16 Aug 2005 19:56:55 +0100
Local: Tues, Aug 16 2005 2:56 pm
Subject: Re: LWP gives 302 Found after update?
John Bokma wrote: I don't recall POST ever being in that redirectable array. I've only been > Aargh, it was even in the manual :-( Many thanks, it fixed my script. I > have no idea however, why it started to fail in the first place. Was POST > removed from the list recently? (I can't remember I updated PHPbb > recently). using Perl for 5yrs though. -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: comp.lang.perl.misc
From: "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
Date: Tue, 16 Aug 2005 14:35:20 -0500
Local: Tues, Aug 16 2005 3:35 pm
Subject: Re: LWP gives 302 Found after update?
Brian Wakem wrote: More likely is that the Web site changed something. > John Bokma wrote: >>Aargh, it was even in the manual :-( Many thanks, it fixed my script. I > I don't recall POST ever being in that redirectable array. I've only been sub redirect_ok my($self, $request) = @_; You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: comp.lang.perl.misc
From: "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
Date: Tue, 16 Aug 2005 13:48:33 -0500
Local: Tues, Aug 16 2005 2:48 pm
Subject: Re: LWP gives 302 Found after update?
Just a quick guess... Dumping $ua:
$VAR1 = bless( { Since a 302 means a redirect is being requested, and WWW::Mechanize might provide a better interface, for interacting with You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2013 Google |