Replies: 3 comments 1 reply
-
There is no such setting available that would timeout a active connection after some period. However you can use the async methods and do this with the future like this example that times out after 12 seconds Unirest.get("http://localhost/something")
.asStringAsync()
.get(12, TimeUnit.SECONDS)
.getBody(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi thx a lot, thats just what I have tried as workaround. No problem with that.
What I am concerned about is that I solved the timeout problem in long running REST calls (up to 25s) by rising the connectionTimeout to 30s.
These timeouts are for sure related in some way to the connectionTime while they are not originated to any kind of connection.
And while most of unirest api is highly intuitiv this connectionTimeout sound misleading to me.
But it runs smooth and I am happy :-)
Am 21.03.2024 um 21:14 schrieb Ryan Bergman ***@***.***>:
There is no such setting available that would timeout a active connection after some period. However you can use the async methods and do this with the future like this example that times out after 12 seconds
Unirest.get("http://localhost/something")
.asStringAsync()
.get(12, TimeUnit.SECONDS)
.getBody();
—
Reply to this email directly, view it on GitHub<#519 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BHDWCX63SC6NIKVHIDZLPBTYZM5TVAVCNFSM6AAAAABE6BHYDKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DQNZQGU3DK>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
So it turns out there is a Request Timeout we have available. Its on the request itself, there is also now a global config option for it in 4.4.0 see #526 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Setting the connectionTimeout seems to be pretty obvious the timeout to connect a http client to the base URL.
But how to set how long a request may take?
In my case it seems that the request gets a TimeoutException after about 10s.
Like for a connectionTimeout. Are there two parameter for http connecting and request duration?
Btw I am using v4.2.9
Beta Was this translation helpful? Give feedback.
All reactions