How to ensure that ASP.NET Web API returns only JSON data ?

 Posted by Rajnilari2015 on 6/22/2016 | Category: ASP.NET Web API Interview questions | Views: 3004 | Points: 40
Select from following answers:
  1. config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/json"));
  2. config.Formatters.XMLFormatter.SupportedMediaTypes.Add (new MediaTypeHeaderValue("text/html") );
  3. config.Formatters.JsonFormatter.SupportedMediaTypes.Add (new MediaTypeHeaderValue("text/xml") );
  4. config.Formatters.XMLFormatter.SupportedMediaTypes.Add (new MediaTypeHeaderValue("text/xml") );
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response