crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

How to set Web API returns data in JSON format only?
Question Posted on 03 Sep 2022Home >> API >> Web API >> How to set Web API returns data in JSON format only?

How to set Web API returns data in JSON format only?
To set that Web API returns data in JSON format we use below two steps:-

(1)In First step we open WebApiConfig.cs file

(2)In second step we add below line to WebApiConfig.cs file

config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue(“application/json”))
0
0



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

What do you mean by content negotiation in .NET Web API?

Is it possible to return view from .NET Web API method?

Difference between RESTAPI and RESTful API?

Write the five most common differences between MVC and WEBAPI?

What do you mean by TestAPI?






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap