Monday, 12 February 2018

How to return only json response from webapi

in webapi confuguration file add line-


var appXMLType=  config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType=="application/xml");

config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXMLType);

No comments:

Post a Comment