Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
Partner API
Composite API
Open API
Internal API
Composite API
Soap API
FullContact API
Amazon S3 API
Boss Mobile
Fujezone Mobile
 Nokia Mobile
 :) Hot Jobs
 
 :) Latest Articles


  

 


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

Home >> 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



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


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?






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |