Option to set custom timeout for request
See original GitHub issueKtor Version
1.2.0
Ktor Engine Used(client or server and name)
CIO
client
Feedback
Is it possible to set a custom timeout for request, not client? Something like
client.call("url", timeout = 20) { ... }
For now, I see only feature to set timeout for client:
HttpClient(CIO) {
engine { requestTimeout = 20 }
}
My use case
I want to use the same client for long polling and common requests.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Setting a Request Timeout for a Spring REST API - Baeldung
Spring provides us with a property called spring.mvc.async.request-timeout. This property allows us to define a request timeout with millisecond ...
Read more >Always use a timeout for http requests | by Abu Ashraf Masnun
By setting a timeout, we're basically saying, if the server doesn't respond within this time, I can no longer keep waiting for it...
Read more >How to Timeout a fetch() Request - Dmitri Pavlutin
A good approach when making network requests is to configure a request timeout of about 8 - 10 seconds. As shown in the...
Read more >How to set a timeout on a http.request() in Node?
var req = http.request(options, function(res) { // Usual stuff: on(data), on(end), ...
Read more >How to set a timeout for a Curl request? - ReqBin
You can set a timeout for connecting to the server with the --connect-timeout command-line option and a timeout for the total request time ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since 1.3.1 you can use HttpTimeout feature
https://ktor.io/clients/http-client/features/timeout.html
Sure! It’ll be possible to do with the
HttpTimeout
feature.