user1702595 user1702595 - 1 year ago 62
Ruby Question

How do I Express this PHP in Ruby?

I need a neat and tidy and elegant way to do this in Ruby. It is a simple get what is on teh page and out put it tot eh screen.

echo file_get_contents("");

Answer Source

You can use net/http like this:

require 'net/http'
puts Net::HTTP.get('', '/')

You can also use get_print, like this:

Net::HTTP.get_print('', '/')