Skip to content

Instantly share code, notes, and snippets.

@jonnii
Created September 20, 2012 20:08
Show Gist options
  • Save jonnii/3758049 to your computer and use it in GitHub Desktop.
Save jonnii/3758049 to your computer and use it in GitHub Desktop.
gtfo xml
var defaultFormatters = GlobalConfiguration.Configuration.Formatters
.Where(f => f.SupportedMediaTypes
.Any(m => m.MediaType.ToString(CultureInfo.InvariantCulture) == "application/xml"
|| m.MediaType.ToString(CultureInfo.InvariantCulture) == "text/xml"))
.ToList();
foreach (var match in defaultFormatters)
{
GlobalConfiguration.Configuration.Formatters.Remove(match);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment