How to return only Json response from webapi method using c#?

Paste the below code in WebApiConfig.cs file,

config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/json"));

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

Comments

Popular posts from this blog

Top MNC Interview Questions- Full Stack Developer

Interview Questions-2

How to get the user details, user current level, next level, Rank in sql server