Skip to content

Instantly share code, notes, and snippets.

@pedroreys
Created February 17, 2012 03:11
Show Gist options
  • Save pedroreys/1850239 to your computer and use it in GitHub Desktop.
Save pedroreys/1850239 to your computer and use it in GitHub Desktop.
web API Message Handler configuration
protected void Application_Start()
{
//Default Registration and configuration stuff
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
BundleTable.Bundles.RegisterTemplateBundles();
//Call to a Configure method created to add message handlers to the Request pipeline
Configure(GlobalConfiguration.Configuration);
}
static void Configure(HttpConfiguration configuration)
{
configuration.MessageHandlers.Add(new NotAcceptableConnegHandler());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment