I need to connect to an endpoint that serves out JSON via REST interfaces. I can't really find anything that combines these 2 technologies in a coherent manner.
I am looking for a library that will let me get started quickly.
I need to connect to an endpoint that serves out JSON via REST interfaces. I can't really find anything that combines these 2 technologies in a coherent manner.
I am looking for a library that will let me get started quickly.
ServiceStack.Text is probably one of the easiest ways to do this.
Background: ServiceStack.Text is an independent, dependency-free serialization library that contains ServiceStack's text processing functionality
Example
The
PostJsonToUrl
andFromJson
extension methods are some nice syntactic sugar in my opinion.I would take a look at RestSharp. It's very straight forward to get up and running and has an active following.
Getting started guide: https://github.com/restsharp/RestSharp/wiki
Deserialization: https://github.com/restsharp/RestSharp/wiki/Deserialization
The HttpCLient and the JSONValue Type from the WCF Web API should get you on your way. Download the source and look at the samples. There are many samples for working with JSON on the client. http://wcf.codeplex.com/releases
Also see
http://blog.alexonasp.net/
You can use Json.Net library and this extension class that makes use of
DynamicObject
Some usage examples:
EDIT:
Here is another sample without
DynamicObject