美文网首页
application/xml与text/xml之间的区别

application/xml与text/xml之间的区别

作者: 石宝宝 | 来源:发表于2018-07-04 09:51 被阅读35次

    XML has two MIME types, application/xml and text/xml. These are often used interchangeably, but there is a subtle difference which is why application/xml is generally recommended over the latter.

    Let me explain why: according to the standard, text/*-MIME types have a us-ascii character set unless otherwise specified in the HTTP headers. This effectively means that any encoding defined in the XML prolog (e.g. ) is ignored. This is of course not the expected and desired behavior.

    “application/xml is generally the preferred mime type. For text/xml it appears the encoding will generally be treated as us ascii regardless of what is specified in the XML document header (unless otherwise specified in the HTTP headers).”

    相关文章

      网友评论

          本文标题:application/xml与text/xml之间的区别

          本文链接:https://www.haomeiwen.com/subject/ndosuftx.html