0

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); 

1 Answer 1

0

In your call to .Create(...) method, either pass an instance of Uri or include protoctol, i.e. http://example.com:8080.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.