问题描述
这更多是关于text/xml
和application/xml
之间差异的一般问题.我是写Web服务的新手(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之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!