From: cremes.devlist@... Date: 2006-06-13T04:39:26+09:00 Subject: Re: Get file over web On Jun 12, 2006, at 2:22 PM, Magnus Holm wrote: > Hi! I'm looking for a function to get the contents from a file on the > web into a string. Something like in PHP: $string = > file_get_contents("http://php.net"); require 'net/http' require 'uri' url = URI.parse('http://www.example.com/index.html') res = Net::HTTP.start(url.host, url.port) {|http| http.get('/index.html') } puts res.body The HTTP get is put into the 'res' variable. 'res.body' is the String. See the documentation for Net::HTTP at http://ruby-doc.org/stdlib/ cr