c# - Calling a rest API windows 10 IoT with a Raspberri pi -


i'm trying simple calling rest api using universal app windows 10 iot can't find way it.

normally use:

private xelement importdata(string sourceurl)     {          webclient wc = new webclient();          string source = wc.downloadstring(sourceurl);         return xelement.parse(source, loadoptions.none);      } 

but isn't available.

you should use httpclient instead of webclient. try this

httpclient client = new httpclient(); string url = "url here"; httpresponsemessage response = await client.getasync(url); return response.content.readasstring(); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -