Michael Hale <mhale / rolemodelsoft.com> wrote: > When I run this on windows against a url that returns a 302 it > recurses through again and gets to the correct url. However running > this same code on debian with ruby 1.6 I get the following error on my > stack trace. Any suggestions? > > ERROR: 302 Moved Temporarily > /usr/local/lib/ruby/lib/ruby/1.6/net/protocol.rb:230:in `error!' > /usr/local/lib/checkout/ruby/lib/ruby/1.6/net/http.rb:1233:in > `value' > /usr/local/lib/checkout/ruby/lib/ruby/1.6/net/http.rb:575:in `get' > it might come from the version of http.rb that you have. from the http.rb rdoc about HTTP#get: --BEGIN-- In version 1.1, this method might raises exception for also 3xx (redirect). On the case you can get a HTTPResponse object by "anException.response". In version 1.2, this method never raises exception. --END-- > <snippet> > > REDIRECT = "302" > OK = "200" > SERVER_ERROR = "500" > > response, = http.get(url.request_uri, headers, content) > case(response.code) > when REDIRECT > successful = load_page(response['location']) > when SERVER_ERROR > message = "Loading the url <#{url}> resulted in an internal > server error: \n<#{content}>" > when OK > successful = true > else > message = "Loading the url <#{url}> resulted in an unknown > response code: #{response.code}" > end > > </snippet> take a look at (for debian) /usr/lib/ruby/1.6/net/http.rb there is some example in the rdoc. -- FreeMan // please note that i'm not to be held responsible // for any damage to your brain after reading this