Use the following.
Console.WriteLine(JsonSerializer.Serialize(TODO, new JsonSerializerOptions { WriteIndented = true }));
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Thank you for this very helpful forum.
I have this API request that is a GET request and it returns a massive JSON text. So, what is the easiest way to make the JSON file properly formatted and usable? This is what the code looks like, by the way, that gets the massive text return. The way it is now, when the code is run, it dumps the unformatted text to the console.
Please advise and, again, much thanks for this service.
Use the following.
Console.WriteLine(JsonSerializer.Serialize(TODO, new JsonSerializerOptions { WriteIndented = true }));
You can use https://github.com/JamesNK/Newtonsoft.Json