In the Ruby RestClient gem, what's the difference between the timeout and open-timeout functionality?
I didn't get anything from the doc file of the gem either.
In the Ruby RestClient gem, what's the difference between the timeout and open-timeout functionality?
I didn't get anything from the doc file of the gem either.
You're reading the wrong documentation (yours is for wgibbs-rest-client which has not been updated since 2009): here's the right one. But that one does not say anything about the difference either, although it is simple:
:open_timeout
is the timeout for opening the connection. This is useful if you are calling servers with slow or shaky response times.
:timeout
is the timeout for reading the answer. This is useful to make sure you will not get stuck half way in the reading process, or get stuck reading a 5 MB file when you're expecting 5 KB of JSON
.
RestClient.get
is calling execute
like this: Request.execute(:method => :get, :url => url, :headers => headers, &block)
–
Angloindian © 2022 - 2024 — McMap. All rights reserved.