Ruby GET Request


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. url = URI.parse('http://www.example.com/index.html')
  5. res = Net::HTTP.start(url.host, url.port) do |http|
  6. http.get('/index.html')
  7. end
  8. puts res.body
  9.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.