Created
January 4, 2017 13:23
-
-
Save escamoteur/45acdb22edf33d4c93a6439cc25b72ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var httpClient = new HttpClient()) | |
{ | |
using (var request = new HttpRequestMessage(HttpMethod.Get, | |
"http://www.burkharts.net/QuoteMyDaySampleData.json")) | |
{ | |
using (var response = await httpClient.SendAsync(request)) | |
{ | |
Stream contentStream = await (response.Content.ReadAsStreamAsync()); | |
var json = new JsonSerializer(); | |
using (var reader = new StreamReader(contentStream)) | |
{ | |
list = (List<MyDay>) json.Deserialize(reader, typeof(List<MyDay>)); | |
} | |
contentStream.Dispose(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment