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

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.

Replies are listed 'Best First'.
Re^4: Flickr::API and using a proxy
by zmerlinz (Novice) on Dec 08, 2006 at 15:42 UTC
    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).

        sorry if i am being a little thick here. i have tried putting the proxy details back in again. I know that the proxy details themselves are correct. the Flickr code still doesn't work if i put the proxy details in (same errror as before, connection refused). I need to work out a way of telling $response to use the proxy settings, but the ways i try tell me that i can't use an object of Flickr::API::Response. could i have another clue or hint? cheers