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

Easy redirect_ok

Thread Next
From:
Marcus Brito
Date:
August 23, 2001 05:24
Subject:
Easy redirect_ok
Message ID:
3B84F87B.5000308@animegaiden.com.br
A quick question to LWP designers: what was the motivation for making 
the redirect_ok a method, instead of a property?

When a developer wants to make a single request using a different 
behavior than the default, and s/he must subclass UserAgent. Isn't this 
too overkill? I can think of a few situations where subclassing 
UserAgent would be actually better.

Wouldn't it be so much simpler if one could do something like this:

$req = HTTP::Request->new('GET', 'http://www.some-host.com');
$req->redirect_ok = 0;

or

$req = HTTP::Request->new('POST', 
'http://www.some-host.com/someform.php', [name1 => value1]);
$req->redirect_ok = 1;

--
Pazu


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