title: HTTP POST in .NET Micro Framework - Exception on GetRequestStream()
body: <p>I am attempting to make an HTTP POST from a Fez Panda II microcontroller board using the .NET Micro Framework (C#), but the following code throws an exception you can see after the code snippet while I attempt to get the request stream. I can't seem to find anything about this particular error anywhere on the internet.</p>
  
  <pre><code>    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.urlofthewebsite.com/Word/");
  
      string name = "00ABCDEFDEADBEEF";
      string rawData = "2012-02-08\t14:53:08\t755F66";
  
      try
      {
              string postData = "deviceID=" + name + "&amp;rawData=" + rawData;
  
              Debug.Print(postData);
  
              byte[] data = Encoding.UTF8.GetBytes(postData);
              //request.ContentType = "application/x-www-form-urlencoded";
              //request.ContentLength = data.Length;
  
              //Set parameters of web request for HTTP POST
              request.Method = "POST";
              request.ContentType = "application/x-www-form-urlencoded";
              request.ContentLength = data.Length;
              request.KeepAlive = false;
  
              //Create a stream to send the post data to
              //ERROR OCCURS HERE
              Stream postDataStream = request.GetRequestStream();
  
              etc.
  </code></pre>
  
  <p>Debug output:</p>
  
  <pre><code>    #### Exception System.Exception - 0x00000000 (1) ####
      #### Message: DNS server IP address was not found.
      #### GHIElectronics.NETMF.Net.Dns::GetHostEntry [IP: 0038] ####
      #### GHIElectronics.NETMF.Net.HttpWebRequest::EstablishConnection [IP: 00e1] ####
      #### GHIElectronics.NETMF.Net.HttpWebRequest::SubmitRequest [IP: 0013] ####
      #### GHIElectronics.NETMF.Net.HttpWebRequest::GetRequestStream [IP: 0008] ####
      #### Fresh_Step.Program::httpPostRawData [IP: 0052] ####
      #### Fresh_Step.Program::Main [IP: 0004] ####
  A first chance exception of type 'System.Exception' occurred in GHIElectronics.NETMF.W5100.Http.dll
  </code></pre>
  
  <p>What could the problem be? Any help is very much appreciated. If additional information is required, I'll be glad to provide it.</p>