加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-16 21:54:03 所属栏目:安全 来源:网络整理
导读:这更多是关于text / xml和application / xml之间的区别的一般问题。 我对编写webservices(REST-Jersey)相当新。我一直在生产应用程序/ xml,因为它是显示在大多数教程/代码示例,我一直在使用学习,但我最近发现了关于text / 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.

(强调我)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读