Prettify JSON with C#

less than 1 minute read

Interestingly, JSON.Net supported the feature already. The following’s the code.

var content = Encoding.UTF8.GetString(message.Body);
var beautified = JToken.Parse(content).ToString(Formatting.Indented);

Categories:

Updated:

Comments