Method: HTTPX::Response::Body#each
- Defined in:
- lib/httpx/response/body.rb
#each ⇒ Object
yields the payload in chunks.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/httpx/response/body.rb', line 88 def each return enum_for(__method__) unless block_given? begin if @buffer rewind while (chunk = @buffer.read(@window_size)) yield(chunk.force_encoding(@encoding)) end end ensure close end end |