Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using (var _myClient = new HttpClient())
  2. {
  3.     var vUri = new Uri("http://applipodcast.radiofrance.fr/export/podcast.gz");
  4.     using (var response = await _myClient.GetAsync(vUri))
  5.     {
  6.         if (response != null && (response.StatusCode == Windows.Web.Http.HttpStatusCode.Ok ))
  7.         {
  8.             try
  9.             {
  10.                 var vBuffer = await response.Content.ReadAsBufferAsync();
  11.                 var vArray = vBuffer.ToArray();
  12.             }
  13.             catch (Exception ex)
  14.             {
  15.             }
  16.         }
  17.         else
  18.         {
  19.             string vError = await response.Content.ReadAsStringAsync();
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement