3
非常感谢您为任何帮助提供帮助。
我有一个Web API OData项目,一切都很好。我现在试图使用$ format参数返回xml而不是JSON,而不是指定头部请求,并且它不起作用。我试过这些方法:
http://localhost:3845/api/Customer?$format=application/xml
http://localhost:3845/api/Customer?$format=xml
http://localhost:3845/api/Customer?$format=application/xml;odata.metadata=full
所有没有成功。本文说这是可能的:http://blogs.msdn.com/b/webdev/archive/2014/03/13/getting-started-with-asp-net-web-api-2-2-for-odata-v4-0.aspx
我已经更新了所有的NuGet包,但似乎总是忽略该请求,而我每次都得到JSON。
再次感谢您的任何想法。最诚挚的问候......
谢谢Yi,我很感激你花时间回答这个问题。 – DanielG 2014-10-09 13:09:49