in reply to Re: Flickr::API and using a proxy
in thread Flickr::API and using a proxy

if i try with out the proxy, the dumper tells me that the connection was refused to www.flickr.com:80 so it does seem that it needs to be told about the proxy to get out to flickr.com

Replies are listed 'Best First'.
Re^3: Flickr::API and using a proxy
by Corion (Patriarch) on Dec 08, 2006 at 15:27 UTC

    Sorry - my first question was misleading then. Try print Dumper $response to see what actually gets returned from Flickr::API and then you should know why $ua->get() on that doesn't work.

      Here is the output from dumper
      Success: 0 Error code: 0 $VAR1 = bless( { 'success' => 0, 'tree' => undef, '_msg' => 'Can\'t connect to www.flickr.com:80 (conne +ct: Connection refused)', 'error_code' => 0, '_content' => '500 Can\'t connect to www.flickr.com:8 +0 (connect: Connection refused) ', 'error_message' => 'API returned a non-200 status cod +e (500)', '_headers' => bless( { 'client-warning' => 'Internal +response', 'client-date' => 'Fri, 08 Dec +2006 15:40:38 GMT', 'content-type' => 'text/plain' }, 'HTTP::Headers' ), '_rc' => 500, '_request' => bless( { '_content' => 'baz=quux&method +=flickr.test.echo&foo=bar&api_key=7d709a71710fa4b986f836053bcf0792', '_uri' => bless( do{\(my $o = +'http://www.flickr.com/services/rest/')}, 'URI::http' ), '_headers' => bless( { 'user-a +gent' => 'libwww-perl/5.805', 'conten +t-type' => 'application/x-www-form-urlencoded', 'conten +t-length' => 81 }, 'HTTP: +:Headers' ), 'api_method' => 'flickr.test.e +cho', '_method' => 'POST', 'api_args' => { 'baz' => 'quux +', 'method' => 'f +lickr.test.echo', 'foo' => 'bar' +, 'api_key' => ' +' #removed the key } }, 'Flickr::API::Request' ) }, 'Flickr::API::Response' );

        What I was unsuccessfully trying to lead you to (my fault) was, that even if you have the right proxy values, $response does not contain what you think, and especially, that $ua->get() does not know what to do with the value contained in $response.

        So, consider now putting your proxy code back in to see if the Flickr API works with the proxy or not, just to see if what you think the problem is (the proxy) actually is the problem (it isn't. Your usage of LWP::UserAgent is the problem).