You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is there any way to change timeouts just for one request?
I think if I do this:
http.timeout(10).get("https://example.com/foo")
I'll actually wind up with a new instance of the client, so probably not re-use the existing connection? Or am I wrong there?
worse, this seems to be true for headers too. What if I want to re-use a persistent connection with keep-alive, but send different headers with different requests? I am pretty sure that is possible with HTTP 1.1... but maybe not with http-rb? it looks to me the only method to set request headers will branch to a new object that does not share the same persistent connection?
Is there any way to keep re-using the keep-alive persistent connection, but set timeouts or headers on on a per-request basis?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If I have a persistent connection client, with a default timeout set.
is there any way to change timeouts just for one request?
I think if I do this:
I'll actually wind up with a new instance of the client, so probably not re-use the existing connection? Or am I wrong there?
worse, this seems to be true for headers too. What if I want to re-use a persistent connection with keep-alive, but send different headers with different requests? I am pretty sure that is possible with HTTP 1.1... but maybe not with http-rb? it looks to me the only method to set request headers will
branch
to a new object that does not share the same persistent connection?Is there any way to keep re-using the keep-alive persistent connection, but set timeouts or headers on on a per-request basis?
Thanks for any tips!
Beta Was this translation helpful? Give feedback.
All reactions