We Recommend

Beginning Ruby: From Novice to Professional Beginning Ruby: From Novice to Professional
Beginning Ruby is a thoroughly contemporary guide for every type of reader wanting to learn Ruby, from novice programmers to web developers to Ruby newcomers. It starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a genuine Ruby application.


Posted By

richardleonard on 12/31/69


Tagged

get http textmate


Versions (?)


Who likes this?

16 people have marked this snippet as a favorite

daniel
talaris
codesmith
jonbaer
jpb
idiotkings
yuconner
fortuity
shazburg
Hollow
gbvb
vali29
copyleft
tkmr
Netzach
skammer


http get


Published in: Ruby 


  1. require \'net/http\'
  2.  
  3. Net::HTTP.start(\'www.domain.com\', 80) {
  4. |http| print( http.get(\'/path/page.rhtml\').body )
  5. }

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: felipec on April 15, 2007

Even simpler ;)

require 'net/http'
Net::HTTP.get_print 'www.example.com', '/index.html'

Link

Posted By: plexus on June 19, 2007

require 'open-uri' print open('http://www.domain.com/path/page.rhtml').read

You need to login to post a comment.