Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@beyond-code-github
Last active December 17, 2015 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save beyond-code-github/5563629 to your computer and use it in GitHub Desktop.
Save beyond-code-github/5563629 to your computer and use it in GitHub Desktop.
Removal of the XML formatter
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
var xmlFormatter = config.Formatters.XmlFormatter;
config.Formatters.Remove(xmlFormatter);
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
config.EnableSystemDiagnosticsTracing();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment