ServiceStack.Text is probably one of the easiest ways to do this.
Background : ServiceStack.Text is an independent dependency-free serialization library library that contains ServiceStack text processing functionality
Example
using ServiceStack.Text; // Create our arguments object: object args = new { your = "Some", properties = "Other", here = "Value", }; var resultString = fullUrl.PostJsonToUrl(args); results = resultString.Trim().FromJson<T>();
Extension methods PostJsonToUrl
and FromJson
are, in my opinion, good syntactic sugar.
Dan esparza
source share