Skip to content
instance method

Net::HTTPSession#read_timeout=

read_timeout=(sec)

Sets the read timeout, in seconds, for self to integer sec; the initial value is 60.

Argument sec must be a non-negative numeric value:

Example
http = Net::HTTP.new(hostname)
http.read_timeout # => 60
http.get('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
http.read_timeout = 0
http.get('/todos/1') # Raises Net::ReadTimeout.