How do I return JSON data in Web API?

Return Data In JSON Format From Web API

  1. $.ajax({
  2. type: ‘GET’,
  3. dataType: ‘xml’,
  4. ContentType: “application/rss+xml”,
  5. success: function(data, textStatus, xhr) {
  6. console.log(data);
  7. },
  8. error: function(xhr, textStatus, errorThrown) {

For More Information Please Refer: https://www.c-sharpcorner.com/blogs/return-data-in-json-format-from-web-api