The net/http Library : net http library « Network « Ruby






The net/http Library


require 'net/http'

Net::HTTP.start('http://www.rubyinside.com/') do |http|
  req = Net::HTTP::Get.new('/test.txt')
  puts http.request(req).body
end

 








Related examples in the same category

1.turn a URL into the various pieces needed by net/http.
2.Get body of response