Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(UWP) WebClient and downloading data from URL in

How do you download data from an url in UWP? I'm used to using WebClient's DownloadData-method, but it can't be used anymore.

like image 530
stonecompass Avatar asked Oct 14 '15 10:10

stonecompass


1 Answers

.NET for UWP does not have the WebClient class.

But you have several alternative ways to download the data from URL in UWP.

For example:

    var request = WebRequest.CreateHttp("http://www.bing.com");

    var donnetClient = new System.Net.Http.HttpClient();

    var winrtClient = new Windows.Web.Http.HttpClient();

If you want to download the data at background, you can use the BackgroundDownloader class

like image 186
Jeffrey Chen Avatar answered Sep 24 '22 12:09

Jeffrey Chen