From: Massimiliano Mirra Date: 2002-10-10T00:53:58+09:00 Subject: Re: reading from a URL On Tue, Oct 08, 2002 at 03:22:07AM +0900, GOTO Kentaro wrote: > > IO. Does something like that exist? If not, is there an easier way than > > using Net::HTTP? > > If you have Ruby 1.7, try > > require "net/http" > require "uri" > content = Net::HTTP.get_print(URI.parse("http://www.example.com/index.html")) > > If not, > > require "net/http" > require "uri" > uri = URI.parse("http://www.example.com/index.html") > content = Net::HTTP.get(uri.host, uri.request_uri, uri.port) > > Read net/http.rb if you would need http auth, redirection or proxy server. > This library includes the documentation of itself. > > Or try WebFetcher in RAA. Is there a std lib way that works both for 1.6 and 1.7? Massimiliano