- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
由于 Faraday 没有文档,我无法在任何地方找到它。法拉第什么是“timeout”,什么是“open timeout”?
最佳答案
如果您在 https://github.com/lostisland/faraday/blob/master/lib/faraday/request.rb 查看源代码然后你会看到:
# :timeout - open/read timeout Integer in seconds
# :open_timeout - read timeout Integer in seconds
也许不是很有帮助?好吧,如果您在 https://github.com/lostisland/faraday/blob/master/lib/faraday/adapter/net_http.rb 查看 Faraday 的 Net::HTTP 适配器,你会看到:
http.read_timeout = http.open_timeout = req[:timeout] if req[:timeout]
http.open_timeout = req[:open_timeout] if req[:open_timeout]
所以 Faraday 的 open_timeout 等同于 Net::HTTP 的 open_timeout,记录为:
Number of seconds to wait for the connection to open. Any number may be used, including Floats for fractional seconds. If the HTTP object cannot open a connection in this many seconds, it raises a TimeoutError exception.
Faraday 的 timeout 等同于 Net::HTTP 的 read_timeout,记录为:
Number of seconds to wait for one block to be read (via one read(2) call). Any number may be used, including Floats for fractional seconds. If the HTTP object cannot read data in this many seconds, it raises a TimeoutError exception.
关于ruby - 法拉第的 "timeout"和 "open timeout"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10322283/
我正在尝试使用 Faraday 将路由 A(Sinatra 应用程序)中生成的小有效载荷放入路由 B。所以代码基本上是这样的: post "/routeA" do foo.save foo_i
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我正在尝试为我的 Rails 应用程序的用户设置 OAuth 到 GetPocket ( http://getpocket.com )。 在 Pocket Authentication 文档 ( ht
我想使用 Faraday 发送一个带有 JSON 正文(用于搜索)的获取请求,但我收到了上述错误。我认为 Proc 中的 self 把事情搞砸了,但这与它无关。我正在关注 [faraday githu
我想向 API 发送 POST 请求。这是我的代码: conn = Faraday.new(url: BASE) do |faraday| faraday.response :logger f
作为我正在尝试编写的 Recipe (新手)的一部分,我使用 berks 安装来自其他 Recipe 的依赖项,最终当我运行时 berks install ,我遇到证书验证错误。任何人都可以帮助我知道
我将一个旧脚本迁移到一个新的 CentOS box 并在运行脚本时收到以下消息: Faraday: you may want to install system_timer for reliable
我正在尝试将一些代码从 HTTPParty 转换为 Faraday。以前我用的是: HTTParty.post("http://localhost/widgets.json", body: { nam
我是一名优秀的程序员,十分优秀!