Let's say I am expecting a simple JSON response from an API like so:
{
"message": "Source: ",
"incomingUrl": "https://10.1.1/api/echo",
"incomingHeadersCount": 21,
"apiVersion": "1.0"
}
I can use JsonNode to parse it and output the lines. This requires me to access it by specifying the key:
var parsedJson = JsonNode.Parse(apiResponse.Result);
Console.WriteLine(parsedJson["message"]);
I'd prefer to do something like this where I don't have to know any of the keys:
foreach (var item in parsedJson)
{
Console.WriteLine(item);
}
This should return, "Source: ", "https://10.1.1/api/echo", "21", "1.0". Is this possible with JsonNode?