2015-12-17 42 views

回答

0

是的,你需要限制你的API只返回XML。

void ConfigureApi(HttpConfiguration config) 
{ 
    // Remove the JSON formatter 
    config.Formatters.Remove(config.Formatters.JsonFormatter); 
} 

你可以找到更多有關內容協商中的Web API這裏:http://www.asp.net/web-api/overview/formats-and-model-binding/content-negotiation

在這裏: How do I specify if I want JSON or XML in ASP.NET Web API?

+0

您好感謝您的解決方案。它是代碼問題還是我們可以通過設置一些Firefox設置來處理它。因爲url可以在其他機器的firefox上正常工作。我們只在一臺機器上得到這個問題 –