Hammy has asked for the wisdom of the Perl Monks concerning the following question:
Here is the code I use to try to get Perl to print out the same image. I stole this code from a seperate thread here on perlmonks.com. I wrote my own code and got the same result.http://xml.sa.mapquest.com:80/?transaction=mapimage&datalen=153&data=7 +1e3Q01g%7EgHl04e%28cN1os1%22%3E0wR3KkDxayw%7CY%25+0As9wU75kgit%24TU%3 +Dna%3FH%3EJh9FL7nFsU40%5DltBFj%3A%2Bv%26b%7B2Ys2xuSx%23kMobGl%2B+tvDh +BP%23%2CbF8b29
Thanks in advance for whatever suggestions you may have for me.my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; $mapURL = "http://xml.sa.mapquest.com:80/?transaction=mapimage&datalen +=153&data=71e3Q01g%7EgHl04e%28cN1os1%22%3E0wR3KkDxayw%7CY%25+0As9wU75 +kgit%24TU%3Dna%3FH%3EJh9FL7nFsU40%5DltBFj%3A%2Bv%26b%7B2Ys2xuSx%23kMo +bGl%2B+tvDhBP%23%2CbF8b29" my $response = $ua->get($mapURL, 'User-Agent' => 'Mozilla/5.0 [en] (Windows; U; Windows NT 6.0)', 'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, i +mage/png, */*', 'Accept-Charset' => 'iso-8859-1,*,utf-8', 'Accept-Language' => 'en-US', ); if ($response->is_success) { print $response->content; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error Using LWP to display an image
by Anonymous Monk on Jun 26, 2008 at 03:17 UTC |