On 7/26/06, Sam Gentle <sgentle / gmail.com> wrote:
> It's possible to pass a block to HTTPResponse#get, which will yield a
> chunk of data each time. That said, you're probably better served by
> using open-uri, which lets you do this:


irb(main):001:0> require 'net/http'
=> true
irb(main):002:0> Net::HTTPResponse.get
NoMethodError: undefined method `get' for Net::HTTPResponse:Class
        from (irb):2
irb(main):003:0>

I'd rather use the HTTP library because I'd like to use this for other
HTTP methods as well, such as propget, etc.

thanks,
Tim

>
> require 'open-uri'
> open('http://www.google.com') do |f|
> #f is an IO object, yay!
> end
>
> Sam
>
>