In the following code,

Code:
require 'net/http'
url = URI.parse('http:...ww.google.com/')
response = Net::HTTP.start(url.host, url.port) do |http|
http.get(url.path)
end
content = response.body       
puts content
if I miss the / it gives an error.
Could someone explain why?

Any advantage of using the above code than the following shell command
Code:
content=$(curl http:...w.google.com)
and curl does not complain about the missing /