Method: Puppet::HTTP::ResponseNetHTTP#read_body

Defined in:
lib/puppet/http/response_net_http.rb

#read_body {|String| ... } ⇒ Object

Streams the response body to the caller in chunks. Can be used instead of

`Puppet::HTTP::Response.body`, but both methods cannot be used for the same
response.

Yields:

  • (String)

    Streams the response body in chunks

Raises:

  • (ArgumentError)

    raise if a block is not given



22
23
24
25
26
# File 'lib/puppet/http/response_net_http.rb', line 22

def read_body(&block)
  raise ArgumentError, "A block is required" unless block_given?

  @nethttp.read_body(&block)
end