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

How to use youtube api's in your application.

Interview Questions-2

Top MNC Interview Questions- Full Stack Developer