How to set timeout in RestClient gem in Ruby?

You don’t need to monkey patch anything. You can use RestClient::Request directly, like:

RestClient::Request.execute(:method => :get, :url => url, :timeout => 10, :open_timeout => 10)

But remember the worst case scenario is 20 seconds.

Check the other post answer https://stackoverflow.com/a/5445421/565999

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)