Issue #9556 has been reported by Sam Rawlins.

----------------------------------------
Feature #9556: Add HTTP#get block functionality to HTTP.get
https://bugs.ruby-lang.org/issues/9556

* Author: Sam Rawlins
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
This is kind of an alternative to #9527.

HTTP#get can be passed a block. The shortcut method, HTTP.get, however, cannot. This patch adds such functionality.

This allows someone to be able to write the response of a GET, in fragments, without dealing directly with Net::HTTPResponse, like the request in #9527:

    File.open('result.zip', 'wb') {|f|
      Net::HTTP.get('www.example.com', '/file.zip') do |chunk|
        f.write chunk
      end
    }

This patch includes that example as documentation, and a test. It is attached, and available at: https://github.com/srawlins/ruby/compare/add-block-to-http-get

---Files--------------------------------
add-block-to-http-get.patch (2.03 KB)


-- 
http://bugs.ruby-lang.org/