Method: Gem::Net::HTTP.get_print

Defined in:
lib/rubygems/vendor/net-http/lib/net/http.rb

.get_print(uri_or_host, path_or_headers = nil, port = nil) ⇒ Object

:call-seq:

Gem::Net::HTTP.get_print(hostname, path, port = 80) -> nil
Gem::Net::HTTP:get_print(uri, headers = {}, port = uri.port) -> nil

Like Gem::Net::HTTP.get, but writes the returned body to $stdout; returns nil.



769
770
771
772
773
774
775
776
# File 'lib/rubygems/vendor/net-http/lib/net/http.rb', line 769

def HTTP.get_print(uri_or_host, path_or_headers = nil, port = nil)
  get_response(uri_or_host, path_or_headers, port) {|res|
    res.read_body do |chunk|
      $stdout.print chunk
    end
  }
  nil
end