title: HttpWebRequest times out
body: <p>I have read the following 2 articles and have tried implementing the same.</p>
  <p>My code is this and the time out occurs here</p>
  <pre><code>HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
  wr.ContentType = &quot;multipart/form-data; boundary=&quot; + boundary;
  wr.Method = &quot;POST&quot;;
  wr.KeepAlive = false;
  wr.CookieContainer = cookieJar;
  
  wr.Proxy = null;
  wr.ServicePoint.ConnectionLeaseTimeout = 5000;
  Stream rs = wr.GetRequestStream(); // -&gt; Time out error occurs here
  </code></pre>
  <p><a href="https://stackoverflow.com/questions/5827030/httpwebrequest-times-out-on-second-call">Article I read</a></p>
  <pre><code>My code using that as a sample
  HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
  wr.ContentType = &quot;multipart/form-data; boundary=&quot; + boundary;
  wr.Method = &quot;POST&quot;;
  wr.KeepAlive = false;
  wr.CookieContainer = cookieJar;
  
  wr.Timeout = 5000;
  wr.Proxy = null;
  
  wr.ServicePoint.ConnectionLeaseTimeout = 5000;
  wr.ServicePoint.MaxIdleTime = 5000;
  
  Stream rs = wr.GetRequestStream(); //--&gt;Time out error
  </code></pre>
  <p>Any clues would be helpful. At times I can get 1 request through and all other request fail or everything fails. Am posting to a HTTPS site. No issues when running with Fiddler</p>
  <p>UPDATE 1:
  I tried following zbugs ideas but that resulted in same issue. the first request goes through the subsequent ones fail.  I am closing all response streams as well as calling abort on my request object.</p>