title: C# HttpWebRequest returns blank
body: <p>I have been reading through innumerable related questions to my problem but none of them have resolved my issue.  I am making a HttpWebRequest in c# in which I post data and then read the response except that the response always returns as blank.  I have tried changing <code>request.contentType</code>, encoding the data in various formats from unencoded, ASCII, &amp; UTF8.  No matter what I do my response is blank.  Also as a side note, my request is going through layer 7.  </p>
  
  <pre><code>var request = (HttpWebRequest)WebRequest.Create(serviceURL);
  var postData = "\"device\"=\"9856\"";
  var data = Encoding.ASCII.GetBytes(postData);
  //request.ContentType = "application/x-www-form-urlencoded";
  request.ContentType = "application/json; charset=utf-8";
  request.Timeout = 5000;
  request.Headers.Add("Authorization", b64);
  request.Headers.Add("reqtime", hmacTS);
  request.Headers.Add("appkey", APP_KEY1);
  request.Method = "POST";
  request.ContentLength = data.Length;
  
  try
  {
      using (var stream = request.GetRequestStream())
      {
          stream.Write(data, 0, data.Length);
      }
      var response = (HttpWebResponse)request.GetResponse();
      using (var streamReader = new StreamReader(response.GetResponseStream()))
      {
          var result = streamReader.ReadToEnd();
          updateWindow(this, "Results: " + result);
          updateWindow(this, "Type: " + response.ContentType);
          updateWindow(this, "Content Length: " + response.ContentLength);
      }
  }
  catch (WebException a)
  {
      updateWindow(this, "ERROR: " + a);
  }
  </code></pre>
  
  <p>My response show as:</p>
  
  <pre><code>Results:  
  Type: application/octet-stream
  Content Length: 0
  </code></pre>
  
  <p>Just to update everyone, I finally got to the root of the problem.  The service provider had to restart their server because the database connection had went out.  After about a week of fighting with this code I guess they decided to check finally for me.....  Thanks to all who tried to help!</p>