Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Net::HTTPRequest.new

new(path, initheader = nil)

Creates an HTTP request object for path.

initheader are the default headers to use. Net::HTTP adds Accept-Encoding to enable compression of the response body unless Accept-Encoding or Range are supplied in initheader.

also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1