Content Negotiation

You would have noticed by now that all our examples had data from the Web API service in XML format. Typically, while building mobile web applications, JSON is the preferred format and sometimes we may need to use either of these formats or some other custom formats. Thanks to Web API's Content Negotiation feature, clients can tell Web API services what content format it accepts, and Web API can serve the client with the same format automatically; provided that the format is configured in Web API. It supports XML and JSON formats only out of the box.

JSON is the preferred data interchange format these days because of the following reasons:

  • JSON is lightweight and bandwidth non-intensive.
  • JavaScript can directly consume JSON and ...

Get Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API 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.