I am writing my first C # application for Windows 10 IoT. Everything works for me, my web requests, etc., And I can get the desired content for rendering for the user. But ... this is in JSON, and I cannot represent it in a regular variable so that I can only select one property.
JSON Result
{
"date":"2017-07-09",
"period":"year",
"views":970347,
"visitors":150013,
"likes":136,
"reblogs":13,
"comments":1099,
"followers":145
}
I tried adding the Nuget package for NewtonSoft JSON (JSON.NET) and it does not seem to work on rPI ARM CPU. So I started using the class Windows.Data.JSON.JsonObject.
I am analyzing the JSON response for my application using JSonObject.Parse()with this line, and then when I debug, I see the following.
JsonObject meme = JsonObject.Parse(ResponseContent);

I can see all the values that I want there, under meme. JSonObject offers methods GetNamedString()and GetNamedObject(), but I get completion errors for both:{"A method was called at an unexpected time.\r\n\r\nThis is not a string value. Use ValueType property to get the type."}
PowerShell, $response / $Response.Views, , #. , , , , , JSON .
- Followers and Visitors JSON , . webrequest... JSON Parse.