Posted By

eugegim on 11/18/08


Tagged

get textmate ruby request Net


Versions (?)

Ruby GET Request


 / Published in: Other
 

  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  

You need to login to post a comment.