In the following code,
if I miss the / it gives an error.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
Could someone explain why?
Any advantage of using the above code than the following shell command
and curl does not complain about the missing /Code:content=$(curl http:...w.google.com)
