Clear all formatters and add Json formatter back.
GlobalConfiguration.Configuration.Formatters.Clear();
GlobalConfiguration.Configuration.Formatters.Add(new JsonMediaTypeFormatter());
EDIT
I added it to Global.asax
inside Application_Start()
.
More Related Contents:
- How to add Web API to an existing ASP.NET MVC 4 Web Application project?
- Difference between ApiController and Controller in ASP.NET MVC
- ASP.NET MVC 4 Web API Authentication with Membership Provider
- Web API and ValidateAntiForgeryToken
- Redirect from asp.net web api post action
- Return a JSON string explicitly from Asp.net WEBAPI?
- ApiController returns 404 when ID contains period
- How do I set the request timeout for one controller action in an asp.net mvc application
- AllowAnonymous not working with Custom AuthorizationAttribute
- Passing asp.net server parameters to Angular 2 app
- HTTP Error 500.19 and error code : 0x80070021
- IIS hijacks CORS Preflight OPTIONS request
- ASP.NET MVC 4 Application Calling Remote WebAPI
- How does a method in MVC WebApi map to an http verb?
- Should ServiceStack be the service layer in an MVC application or should it call the service layer?
- Discovering Generic Controllers in ASP.NET Core
- ASP.NET (OWIN) Identity: How to get UserID from a Web API controller?
- ASP.NET Web API, unexpected end of MIME multi-part stream when uploading from Flex FileReference
- How to create two footer rows in jqgrid
- ASP.NET WebApi vs MVC? [closed]
- AutoMapper.Mapper does not contain definition for CreateMap
- Routing in Asp.net Mvc 4 and Web Api
- ASP.Net WebAPI area support
- Nested resources in ASP.net MVC 4 WebApi
- jQuery Ajax calls and the Html.AntiForgeryToken()
- How to mock the Request on Controller in ASP.Net MVC?
- Redirect to external URI from ASP.NET MVC controller
- Traditional ASP .NET Web Forms vs MVC
- change controller name convention in ASP.NET MVC
- Get [DisplayName] attribute of a property in strongly-typed way