text/*
text/xml
File extensions: .xml
Legacy text/xml variant — differs from application/xml on defaults.
What is text/xml?
text/xml is a legacy media type for XML documents. It exists mainly for historical compatibility; application/xml is preferred by modern services because it defaults to UTF-8 encoding while text/xml historically defaulted to US-ASCII.
Typical usage
Older SOAP endpoints, legacy XML APIs.
Common gotchas
Because of the charset default difference, always specify charset=utf-8 explicitly when using text/xml, or migrate to application/xml.
HTTP header example
Response header
Content-Type: text/xml; charset=utf-8Reference
RFC 7303
Frequently asked questions
What is the text/xml MIME type?
text/xml is a legacy media type for XML documents. It exists mainly for historical compatibility; application/xml is preferred by modern services because it defaults to UTF-8 encoding while text/xml historically defaulted to US-ASCII.
What file extension does text/xml use?
Files served as text/xml typically use the extension .xml. The most common is .xml.
How do I set the Content-Type for text/xml?
Send the HTTP response header Content-Type: text/xml; charset=utf-8. Older SOAP endpoints, legacy XML APIs.
Is text/xml an official MIME type?
Yes. text/xml is officially registered with IANA (RFC 7303), so standards-conformant clients recognize it.
What are common mistakes with text/xml?
Because of the charset default difference, always specify charset=utf-8 explicitly when using text/xml, or migrate to application/xml.