Gem httparty 如何设置全局的 timeout,使所有的使用都生效

string2020 · April 15, 2015 · Last by huacnlee replied at April 24, 2015 · 2099 hits

现在系统中,都用了 httparty。

现在想统一设置 timeout,不想改其他的代码,只想改一处地方,即可生效。

请问,有设置的地方吗?

怎么做?

json = Timeout::timeout(5) do
  httparty.get ...
end
You need to Sign in before reply, if you don't have an account, please Sign up first.