这更多是关于text / xml和application / xml之间的区别的一般问题。 我对编写webservices(REST-Jersey)相当新。我一直在生产应用程序/ 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.
(强调我)