I want to override the default timeout for the service call in my ruby code. I open connection as under.
res = Net::HTTP.start(@@task_url.host, @@task_url.port) do |http| http.get("/tasks/#{task_id}") end I tried to set the read_timeout time as under but then I got the NoMethodError exception in my code.
res = Net::HTTP.start(@@task_url.host, @@task_url.port) res.read_timeout = 10 res do |http| http.get("/tasks/#{task_id}") end Suggest me how should I set the read_timeout. And I am looking to set the read_timeout somewhere globally so that I can use that timeout for all my service call through Net::HTTPP.start()
read_timeout.