#handling redirect code h = Net::HTTP.new(ARGV[0] || 'www.ruby-lang.org', 80) url = ARGV[1] || '/' begin resp, data = h.get(url, nil) { |a| } rescue Net::ProtoRetriableError => detail head = detail.data if head.code == "301" uri = URI.create(head['location']) host = uri['host'] url = uri['path'] port = uri['port'] h.finish h = Net::HTTP.new(host,Ęport) retry end endReceived on Wednesday, 25 September 2002 16:20:24 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 July 2008 08:08:44 GMT