Skip to main content

application/xml

application

The MIME type for generic XML documents. RFC 7303 (2014) consolidated text/xml and application/xml recommendations: use application/xml for XML documents not intended for direct human reading (API responses, SOAP, RSS). text/xml is technically equivalent but deprecated in favor of application/xml.

Details

application/xml is defined by RFC 7303 which updated and consolidated earlier XML MIME type guidance.

text/xml vs application/xml: RFC 7303 recommends application/xml over text/xml for XML data not intended for human display. The practical difference is that text/* types default to ISO-8859-1 charset if not specified, while application/xml defaults to UTF-8 (or the encoding declared in the XML declaration).

Structured syntax subtypes: specific XML formats use +xml suffix per RFC 6838: application/atom+xml (Atom feeds) application/rss+xml (RSS feeds) application/soap+xml (SOAP 1.2) application/mathml+xml image/svg+xml

Charset: always include the XML declaration at the top of the document (<?xml version="1.0" encoding="UTF-8"?>) and set charset=utf-8 in Content-Type.

Common use

SOAP web services, XML APIs, RSS/Atom feeds, configuration files

See Also