MailChimp.NET
MailChimp.NET copied to clipboard
How can be timeouts limits setup?
http://apidocs.mailchimp.com/gettingstarted/timeouts.php
How can Stream Timeouts and Connection Timeouts limits setup?
private T MakeAPICall<T>(string apiAction, object args) { ...
Action<System.Net.HttpWebRequest> actionConnectionTimeout = (System.Net.HttpWebRequest x) => x.Timeout = 1;
// Call the API with the passed arguments:
var resultString = fullUrl.PostJsonToUrl(args, actionConnectionTimeout );
results = resultString.Trim().FromJson<T>();
}
I think that with this code, you can put timeout connection to 1 milisecond to test connection timeouts.
Anybody can suggest how to prevent stream timeouts?
Maybe var resultString = fullUrl.PostJsonToUrl(args, actionConnectionTimeout ); with resultString == null?
javihm, I tried that code and it didn't seem to change anything - I always got a 90 second timeout.