End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Net::HTTP#send_request
send_request(name, path, data = nil, header = nil)
lib/net/http.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/net/http.rb, line 1489
def send_request(name, path, data = nil, header = nil)
has_response_body = name != 'HEAD'
r = HTTPGenericRequest.new(name,(data ? true : false),has_response_body,path,header)
request r, data
end
Sends an HTTP request to the HTTP server. Also sends a DATA string if data is given.
Returns a Net::HTTPResponse object.
This method never raises Net::* exceptions.
Example
response = http.send_request('GET', '/index.html') puts response.body
See also
#send_entity
#set_debug_output
#request_post
#sspi_auth
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1