I'm trying to send an http POST request from my netduino, I've been on the netduino forum and there is conflicting reports of this being able to work, the exception occurs on the first line
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("example.com:8080");
string postData = "temperature=" + tempSensor.Temperature;
byte[] data = Encoding.UTF8.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (Stream stream = request.GetRequestStream())
{
for (int i = 0; i < 10; i++)
{
stream.Write(data, 0, data.Length);
Thread.Sleep(1000);
}
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Debug.Print(response.StatusDescription);