API清理xml格式数据

调用API时候,可能会报这个错  //The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'.

解决办法是:

//处理方法 在API的webApiConfig-加此代码
GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();

转载于:https://www.cnblogs.com/zpyplan/p/9618402.html

你可能感兴趣的:(API清理xml格式数据)