Created
September 27, 2013 23:17
-
-
Save aikmeng/6736534 to your computer and use it in GitHub Desktop.
MVC Web API to return JSON values by default. This will still support xml request.
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
var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml"); | |
config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment