Skip to content

Instantly share code, notes, and snippets.

@loe
Created November 19, 2008 02:49
Show Gist options
  • Save loe/26392 to your computer and use it in GitHub Desktop.
Save loe/26392 to your computer and use it in GitHub Desktop.
require 'right_http_connection'
require 'tempfile'
c = Rightscale::HttpConnection.new
f = Tempfile.new('foo')
url = URI.parse('http://example.com/my/big/file')
while data = c.request(:server => url.host, :port => 80, :protocol => 'http', :request => Net::HTTP::Get.new(url.path)).body.read(1024)
f.write(data)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment