You can use open-uri, which is a one liner require 'open-uri' content = open('http://example.com').read