My first question is: why use Net :: HTTP or code to download something that can be done with curl or wget, which are designed to make downloading files easier?
But, since you want to load things using code, I would recommend looking at the Open-URI if you want to follow redirects. Its a standard library for Ruby and is very useful for quick HTTP / FTP access to pages and files:
require 'open-uri' open('latest.zip', 'wb') do |fo| fo.print open('http://wordpress.org/latest.zip').read end
I just ran this, waited a few seconds to finish, loosened the file with the latest.zip file uploaded, and expanded it into a directory containing their contents.
In addition to Open-URIs, HTTPClient and Typhoeus, among other things, make it easy to open an HTTP connection and send requests / receive data. They are very effective and deserve attention.
source share