Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: (jeffa) Re: Lack of LWP::SIMPLE information

by Dog and Pony (Priest)
on Jul 17, 2003 at 21:19 UTC ( #275400=note: print w/replies, xml ) Need Help??


in reply to (jeffa) Re: Lack of LWP::SIMPLE information
in thread Lack of LWP::SIMPLE information

LWP::UserAgent (which LWP::Simple uses) follows redirects by default for GET and HEAD requests - this is a configurable behaviour, see requests_redirectable and redirect_ok in the documentation.

It also stands to reason that only header redirects (ie Status: 302 Moved) is followed. Otherwise the module would need to parse the HTML looking for meta tags. Using the proper modules, or maybe just a simple regexp, this is not too hard to implement yourself, but it doesn't belong in the core module IMO. :)

Another way that some (thankfully few nowadays) do redirects is by scripting, such as javascript. This is a tougher nut to crack if needed.


You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://275400]
help
Chatterbox?
[Corion]: Ah. The magic invocation is set PERL5OPT=-M-lib=. (equivalent of no lib '.';
[Corion]: )
[Corion]: dazz: BTW, the following should work (no Image::Magick installed, so untested): open(my $fh, '<', \$jpegbuffer); $image->Read(file= > $fh);

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-03-27 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (317 votes). Check out past polls.