Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. 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.