Proposal: block_response

Archiloque <code@...>


as the feature is asked time to time I was thinking about enable the users to stream the response

Instead of abstracting the response in a new interface I propose to add a new parameter to to request which would specify a block that will be called with the response, as there's a already have a :raw_response we could have a :block_reponse which would work like this:

debugger_block = do |http_response|
http_response.read_body do |chunk|
p chunk

RestClient::Request.execute(:method => :get, :url => "", :block_response => debugger_block)

what do you think about it ?