Skip to content
instance method

Net::HTTPSession#max_retries=

max_retries=(retries)

Sets the maximum number of times to retry an idempotent request in case of Net::ReadTimeout, IOError, EOFError, Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError, Timeout::Error. The initial value is 1.

Argument retries must be a non-negative numeric value:

Example
http = Net::HTTP.new(hostname)
http.max_retries = 2   # => 2
http.max_retries       # => 2
See also #lock #mkcol #ipaddr= #move also in 4.1 · 3.4