webApi 禁用xml输出格式
protected void Application_Start(object sender, EventArgs e) { //在应用程序启动时注册路由映射 WebAPIConfig.Register(GlobalConfiguration.Configuration); //默认JSON GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear(); }
作者:Kevin
邮箱:334081981@qq.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.