Communicating with a REST service using JSON

When we work with REST services, data is sent over the wire in XML by default. However, REST services can also send back their information in another format such as JavaScript Object Notation (JSON). This can be the case if the service has also got to be accessible from JavaScript code or if the transferred data is to be very compact.

In this recipe, we'll look at how to communicate from Silverlight with a REST service in the JSON format.

Getting ready

This recipe builds on the code created in the previous recipes, so you can continue using your own code for this recipe. Alternatively, you can also use the provided starter solution located in the Chapter08/TalkingToSimpleRESTServices_ReadingWithJSON_Starter ...

Get Silverlight 4 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.