net-http icon indicating copy to clipboard operation
net-http copied to clipboard

Add ability to configure default settings for new connections

Open fatkodima opened this issue 1 year ago • 0 comments

Closes #176.

It should be used by something like this:

Net::HTTP.default_configuration = {
  read_timeout: 1,
  write_timeout: 1
}

http = Net::HTTP.new(hostname)
http.open_timeout   # => 60
http.read_timeout   # => 1
http.write_timeout  # => 1

Probably, there is a better name for the new option. And maybe we should allow more options to be configured, let me know.

fatkodima avatar May 13 '24 22:05 fatkodima