Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Net::HTTP.get_response

Net::HTTP.get_response(hostname, path, port = 80) → http_response
Net::HTTP:get_response(uri, headers = {}, port = uri.port) → http_response

Like Net::HTTP.get, but returns a Net::HTTPResponse object instead of the body string.