I am trying to run a web service that I have built in connection with a project I am building. However I cannot for the life of me get my netduino to actually talk to my service.
Here is the code, does it look bad?
using (var request = (HttpWebRequest)WebRequest.Create(url)) { request.Method = "GET"; request.Accept = "application/json"; request.UserAgent = "OomooTweetNetduino"; try { using (var response = (HttpWebResponse)request.GetResponse()) { if (response.StatusCode == HttpStatusCode.OK) { Debug.Print(response.StatusCode.ToString()); var textStream = response.GetResponseStream(); byte[] buffer = new byte[textStream.Length]; var count = textStream.Read(buffer, 0, int.Parse(textStream.Length.ToString())); char[] chars = Encoding.UTF8.GetChars(buffer); //var s = new string(chars).TrimEnd(' Debug.Print(new string(chars)); } } return true; } catch (Exception e) { WriteAllErrors(e); return false; } }