Skip to content

ServiceStackTextFormatter

Jordan Gray edited this page Feb 4, 2014 · 2 revisions

Project page: WebApiContrib.Formatting.ServiceStack

ServiceStackTextFormatter is a MediaTypeFormatter implementation for ASP.NET Web API that handles the application/json MIME type. It uses ServiceStack.Text for serialization.

By default, ServiceStackTextJsonMediaTypeFormatter uses ISO8601 date format. To change it to use a different date format supported by ServiceStack.Text, provide the JsonDateHandler to be used during the serialization/deserialization process as an argument for the formatter constructor.

var formatter = new ServiceStackTextFormatter(JsonDateHandler.TimestampOffset);