Skip to content

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

class method

Net::HTTP.get_response

(::URI::Generic uri, ?::Net::headers header) ?{ (::Net::HTTPResponse) -> void } -> ::Net::HTTPResponse
(::String host, ::String path, ?::Integer port) -> ::Net::HTTPResponse
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.