Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

¶Re: •Re: LWP::UserAgent subclass to make it follow redirects after POST (like Netscape)

by Anonymous Monk
on Feb 27, 2002 at 00:51 UTC ( #147785=note: print w/replies, xml ) Need Help??


in reply to •Re: LWP::UserAgent subclass to make it follow redirects after POST (like Netscape)
in thread LWP::UserAgent subclass to make it follow redirects after POST (like Netscape)

The latest LWP::UserAgent allows the behavior of redirect_ok to be overridden using the requests_redirectable method.
$ua->requests_redirectable( ); # to read $ua->requests_redirectable( \@requests ); # to set This reads or sets the object's list of request names that $ua->redirect_ok(...) will allow redirection for. By default, this is ['GET', 'HEAD'], as per RFC 2068. To change to include 'POST', consider: push @{ $ua->requests_redirectable }, 'POST'; $ua->redirect_ok($prospective_request) This method is called by request() before it tries to follow a redirection to the request in $prospective_request. This should return a true value if this redirection is permissible. The default implementation will return FALSE unless the method is in the object's requests_redirectable list, FALSE if the proposed redirection is to a "file://..." URL, and TRUE otherwise. Subclasses might want to override this. (This method's behavior in previous versions was simply to return TRUE for anything except POST requests).
  • Comment on ¶Re: •Re: LWP::UserAgent subclass to make it follow redirects after POST (like Netscape)
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://147785]
help
Chatterbox?
[erix]: I don't know but I think extracting that from Pg is probably not so easy (or it would be done more often, no?)
[Corion]: erix: There is somebody who has hacked up some Ruby scripts to do just that, but the Ruby scripts have some hardcoded #defines (well, reimplement those), so the extraction doesn't compile for Windows...
[Corion]: libpg_query
[Corion]: ... and I think "porting" it basically means (re)implementing a C preprocessor and feeding that one with the appropriate #defines for the platforms, and/or providing stub implementations for OS-specific functions that the query parser really wants to call

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-07-23 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (464 votes). Check out past polls.

    Notices?