Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 054adce80b
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (43 sloc) 1.099 kb
using System.IO;
namespace RestSharp.Serializers
{
/// <summary>
/// Default JSON serializer for request bodies
/// Doesn't currently use the SerializeAs attribute, defers to Newtonsoft's attributes
/// </summary>
public class JsonSerializer : ISerializer
{
/// <summary>
/// Default serializer
/// </summary>
public JsonSerializer()
{
ContentType = "application/json";
}
/// <summary>
/// Serialize the object as JSON
/// </summary>
/// <param name="obj">Object to serialize</param>
/// <returns>JSON as String</returns>
public string Serialize(object obj)
{
return SimpleJson.SerializeObject(obj);
}
/// <summary>
/// Unused for JSON Serialization
/// </summary>
public string DateFormat { get; set; }
/// <summary>
/// Unused for JSON Serialization
/// </summary>
public string RootElement { get; set; }
/// <summary>
/// Unused for JSON Serialization
/// </summary>
public string Namespace { get; set; }
/// <summary>
/// Content type for serialized content
/// </summary>
public string ContentType { get; set; }
}
}
Jump to Line
Something went wrong with that request. Please try again.