You can use the overload of JObject.ToString()
which takes Formatting
as parameter:
JObject obj = JObject.FromObject(new
{
typ = "photos"
});
return obj.ToString(Formatting.None);
More Related Contents:
- Cannot deserialize the JSON array (e.g. [1,2,3]) into type ‘ ‘ because type requires JSON object (e.g. {“name”:”value”}) to deserialize correctly
- Detect if deserialized object is missing a field with the JsonConvert class in Json.NET
- Json.net serialize/deserialize derived types?
- How can I deserialize a child object with dynamic (numeric) key names?
- Deserializing JSON when sometimes array and sometimes object
- Cannot deserialize the current JSON object (e.g. {“name”:”value”}) into type ‘System.Collections.Generic.List`1
- How to ignore JsonProperty(PropertyName = “someName”) when serializing json?
- Deserializing JSON when key values are unknown
- Deserializing dates with dd/MM/yyyy format using Json.Net
- Deserializing JSON with unknown object names
- How to convert datatable to json string using json.net?
- How do I convert an escaped JSON string within a JSON object?
- JContainer, JObject, JToken and Linq confusion
- Handling decimal values in Newtonsoft.Json
- Replace part of a JSON with other (using a string token)
- Custom json serialization for each item in IEnumerable [duplicate]
- Cannot deserialize the current JSON array (e.g. [1,2,3])
- Repeated serialization and deserialization creates duplicate items
- How do you Add or Update a JProperty Value in a JObject
- Load multiple concatenated JSON objects from stream
- Parsing a JSON array using Json.Net
- Json.net deserialization null guid case
- Deserialize JSON when a value can be an object or an empty array
- How do C# classes deal with dollar signs in JSON?
- How to convert c# generic list to json using json.net?
- JSON Deserialization – String Is Automatically Converted To Int
- Json.net rename properties
- Newtonsoft JSON for .net is ignoring jsonproperty tags
- How to convert JSON to XML or XML to JSON in C#?
- NewtonSoft.Json Serialize and Deserialize class with property of type IEnumerable