1

How create get url from Visual Studio 2015 for Windows Iot in app C# (Universal App Windows)

Getreponse(); from c# 2015 is deprecated

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://XXX/online?check=useronline");
request.Method = "GET";
using (var response = request.GetResponse())
using (var stream = response.GetResponseStream())
using (var reader = new StreamReader(stream))

enter image description here

leppie
  • 115,091
  • 17
  • 196
  • 297
user3701584
  • 115
  • 2
  • 8

2 Answers2

0

You can take a look this example.

https://ms-iot.github.io/content/en-US/win10/samples/BlinkyWebServer.htm

all request receiving from one function so easily use reqex and make your web service.

0

Universal App Platform has a great class for HTTP.

HttpClient has all you need to get a web resource with a very few lines of code.

var client = new HttpClient();
var content = await client.GetStringAsync(new Uri("http://danvy.tv"));

Check the details here

https://msdn.microsoft.com/en-US/library/windows/apps/xaml/windows.web.http.httpclient.getstringasync

danvy
  • 2,085
  • 12
  • 17