Thursday, November 3, 2016

To get JSON data instead of XML in Web API 2

 // To get JSON data instead of XML, add the following Line in the Resister method of WebApiConfig

            config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));