Below code is throwing a timeout exception after couple of calls (5 or 10 calls), it works fine always when I'm running fiddler in my machine. I read some answers here that if it's working when the fiddler is on then that means it could be a proxy issue, but how it's working some times? I've tried setting a timeout value more than the default value, still it fails.
HttpWebRequest requiredRequest = CreateRequestWithEmptyBody(url);
requiredRequest.ContentType = "application/xml";
try
{
requestStream = requiredRequest.GetRequestStream();
requestStream.Write(requestBodyData, offset: 0, count: requestBodyData.Length);
requestStream.Flush();
}
catch (WebException exc)
{
}
finally
{
requestStream.Close();
}