These days there exists huge amount of API’s. One of the most used formatting is JSON. Consuming JSON with .net is kinda easily but to get full support of intellisense require developer to create classes that match the data provided. Jonathan Keith published nice tool called json2csharp which you can use for that. I will show you how to consume JSON API of my blog.
-
Create a new Blank Metro App
-
Open browser and browse to your json source
-
Open another tab and browse to http://json2csharp.com/, copy-paste all of the json and click Generate
-
Create a new class in visual studio and name it helper.cs
-
On helper.cs replace class helper with all of the code from json2chsarp page
-
Open NuGet manager and install Json.NET
-
Edit MainPage.xaml.cs
That is it. You are done!
Now you can start consuming json API without much effort.