XMLHttpRequest 2 Demo: Overriding the MIME Type

Click the button to trigger the overrideMimeType() demo.

Notice that the Content-Type: response header is text/html; charset=UTF-8, but we have actually requested an XML file. We are going to force the browser to treat the response as XML.

Compare this with the empty value of responseXML when overrideMimeType() isn't used.

Response headers



responseXML