Get body of response : net http library « Network « Ruby






Get body of response


require 'net/http'

url = URI.parse('http://www.rubyinside.com/test.txt')
response = Net::HTTP.get_response(url)
puts response.body

 








Related examples in the same category

1.The net/http Library
2.turn a URL into the various pieces needed by net/http.