用于 web 服务响应的 text/xml 与 application/xml 之间有什么区别 [英] What's the difference between text/xml vs application/xml for webservice response

查看:29
本文介绍了用于 web 服务响应的 text/xml 与 application/xml 之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这更像是一个关于text/xmlapplication/xml 之间区别的一般性问题.我对编写网络服务(REST - Jersey)相当陌生.我一直在制作 application/xml 因为它是我一直用来学习的大多数教程/代码示例中显示的内容,但我最近发现了 text/xml并且想知道它有什么不同,你什么时候会在 application/xml 上使用它?

This is more of a general question about the difference between text/xml and application/xml. I am fairly new to writing webservices (REST - Jersey). I have been producing application/xml since it is what shows up in most tutorials / code examples that I have been using to learn, but I recently found out about text/xml and was wondering what is different about it and when would you use it over application/xml?

推荐答案

这是一个老问题,但现在可以从 RFC 7303 废弃了 RFC3023.简而言之(第 9.2 节):

This is an old question, but one that is frequently visited and clear recommendations are now available from RFC 7303 which obsoletes RFC3023. In a nutshell (section 9.2):

The registration information for text/xml is in all respects the same
as that given for application/xml above (Section 9.1), except that
the "Type name" is "text".

这篇关于用于 web 服务响应的 text/xml 与 application/xml 之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆