对于webservice响应,text/xml和application/xml之间有什么区别

前端之家收集整理的这篇文章主要介绍了对于webservice响应,text/xml和application/xml之间有什么区别前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这更多是关于text / xml和application / xml之间的区别的一般问题。
我对编写webservices(REST-Jersey)相当新。我一直在生产应用程序/ xml,因为它是显示在大多数教程/代码示例,我一直在使用学习,但我最近发现了关于text / xml,并想知道什么是不同的,什么时候使用它over application / xml?

解决方法

从RFC( 3023),第3节,XML媒体类型:

If an XML document — that is,the unprocessed,source XML document
is readable by casual users,text/xml is preferable to
application/xml. MIME user agents (and web user agents) that do not
have explicit support for text/xml will treat it as text/plain,for
example,by displaying the XML MIME entity as plain text.
Application/xml is preferable when the XML MIME entity is unreadable
by casual users.

(强调我)

猜你在找的WebService相关文章