I have a post happening to a rails application from a ruby script. The script creates a variable request as
request = Net::HTTP::Post.new(url.path)
>
One thing to keep in mind is that if read_timeout
is set to a small value such that a timeout does occur...Net::HTTP
will "helpfully" retry the request. For a slow HTTP server, a timeout error may not be raised to the code calling Net::HTTP
until 2x the read_timeout
value.
This certainly was not the behavior I expected.
More info on this topic and how possible solutions differ for Ruby < 2.5 and >= 2.5 may be found here:
https://stackoverflow.com/a/59186209/5299483