title: Time out Exception when invoking GetResponse()
body: <p>I create a <code>WebRequest</code> to post some HTML content to another web server. When I use normal text content, it works, but when I post HTML content I get a time out error when invoking <code>GetResponse()</code>.</p>
  
  <pre><code>WebResponse response = request.GetResponse()
  </code></pre>
  
  <p>How can I figure out the issue?
  I tried adding an error handler for <code>WebException</code> but I could not catch the exception.</p>
  
  <p>Request code :</p>
  
  <pre><code>byte[] byteArray = Encoding.UTF8.GetBytes(sPostData);
  
  // Create a request using a URL that can receive a post. 
  WebRequest request = WebRequest.Create(httpUri);
  // Set the 'Timeout' property in Milliseconds.
  //request.Timeout = 20000;
  // Set the ContentType property of the WebRequest.
  request.ContentType = contentType;
  // Set the Method property of the request to POST.
  request.Method = postMethod;
  // Set the ContentLength property of the WebRequest.
  request.ContentLength = byteArray.Length;
  // Get the request stream.
  using (Stream PostStream = request.GetRequestStream())
  {
      PostStream.Write(byteArray, 0, byteArray.Length);
  }
  // Get the response.
  using (WebResponse response = request.GetResponse())
  {
      // Get the stream containing content returned by the server.
      using (Stream responseStream = response.GetResponseStream())
      {
          using (StreamReader reader = new StreamReader(responseStream))
          {
              string responseFromServer = reader.ReadToEnd();
  
              result = responseFromServer;
          }
      }
  }
  </code></pre>