Created
August 23, 2012 18:20
-
-
Save tugberkugurlu/3439840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Configure(HttpConfiguration config) { | |
config.Formatters.Remove(config.Formatters.XmlFormatter); | |
config.Formatters.Remove(config.Formatters.FormUrlEncodedFormatter); | |
// From DefaultContentNegotiator class: | |
// If ExcludeMatchOnTypeOnly is true then we don't match on type only which means | |
// that we return null if we can't match on anything in the request. This is useful | |
// for generating 406 (Not Acceptable) status codes. | |
config.Services.Replace( | |
typeof(IContentNegotiator), | |
new DefaultContentNegotiator(excludeMatchOnTypeOnly: true) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment