Created
February 15, 2018 12:12
-
-
Save ricardoalcantara/667b0f2e6ee9fd94261f21e569be24fa to your computer and use it in GitHub Desktop.
This file contains hidden or 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 System; | |
using System.Net.Http; | |
namespace simpleHttpClient | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var httpClient = new HttpClient(); | |
var jsonString = httpClient.GetStringAsync("https://jsonplaceholder.typicode.com/posts").Result; | |
var jsonObject = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(jsonString); | |
foreach (var post in jsonObject) | |
{ | |
Console.WriteLine(post.title); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment