Reputation:
I use RestSharp to execute POST request: var response = client.Execute(request);
This request returns an error exception is inside response
: {"The operation has timed out"}
.
What is the reason for this? How to fix it?
Upvotes: 1
Views: 6949
Reputation: 175
If you haven't found an answer yet, look at the Timeout property. The HttpWebRequest default is 100 seconds and I haven't been able to find any data that suggests RestSharp changes the timeout default.
https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.timeout(v=vs.110).aspx
In the following line of code, this would set the timeout to 5 minutes.
request.Timeout = 300000;
Upvotes: 3