I have a JObject (I\'m using Json.Net) that I constructed with LINQ to JSON (also provided by the same library). When I call the ToString() method
JObject
ToString()
Call JObject's ToString(Formatting.None) method.
ToString(Formatting.None)
Alternatively if you pass the object to the JsonConvert.SerializeObject method it will return the JSON without formatting.
Documentation: Write JSON text with JToken.ToString