调用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();