Ok, that's what I was looking for!
Thank you everybody

Daniel DeLorme wrote:
> Scara Maccai wrote:
>>but you can't
>>
>>"reading lines as they come in..."
> 
> 
> chunks are made out of lines; it's not so difficult to process each
> line as the chunks come in:
> 
> buffer = ""
> req = Net::HTTP.new('10.2.1.2')
> req.post('/mycgi', mydata) do |chunk|
>    buffer << chunk
>    while buffer.sub!(/^(.*)\n/,"")
>      do_something_with_line($1)
>    end
> end
> 
> Daniel
> 
>