Anybody aware of default timeout value of RestSharp RestClient ?
3 Answers
RestSharp is using HttpWebRequest under the hood, which has a default timeout of 100 seconds.
Comments
At least some versions of RestSharp (I'm looking at 106.6.10) will use an explicitly set Timeout value when using the async requests, but do not provide a default.
This is because:
The Timeout property has no effect on asynchronous requests made with the BeginGetResponse or BeginGetRequestStream method.
Comments
Starting from the v107 RestSharp stops using the legacy HttpWebRequest class, and uses well-known HttpClient instead. Timeout option now is obsolete and they recommend using MaxTimeout instead.
Regarding the official documentation:
If you don't set a duration, then a default value is used. The default value is currently 100000 ms (100 seconds).
In addition, if you want to change options there is the next syntax:
var options = new RestClientOptions("https://api.myorg.com")
{
ThrowOnAnyError = true,
MaxTimeout = 1000 // ms
};
var client = new RestClient(options);
2 Comments
// ms )