XMLHttpRequest and multipart responses
"Christoph Dorn" <[email protected]> 24 Feb 2007 17:30:27 -0800
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
Does the XMLHttpRequest object support multipart/mixed response content? I am working on the FirePHP project (http://www.firephp.org/) which sends multipart responses in order to embed debug information into the response without affecting how Firefox renders the page. A sample response body for a text/xml file looks like this: --dc4b00ada3c698a5267b44d58caca336 Content-type: text/xml <doc> <item name="test">TestValue</item> </doc> --dc4b00ada3c698a5267b44d58caca336 Content-type: text/firephp DEBUG INFO --dc4b00ada3c698a5267b44d58caca336-- When the XMLHttpRequest returns the responseText attribute contains the entire response body and not just the text/xml section and the responseXML attribute is null. I presume this is the intended and proper result? Is there any way to set an additional header to make the object just read the text/xml section and load the XML document properly? The other option would be to intercept and parse the response to return the text/xml section only to the XMLHttpRequest object. Is this possible? You can see a demo here: http://www.firephp.org/Demo/Tests.htm NOTE: You must have the Firebug and FirePHP extensions installed. Any other suggestions or solutions? Thanks Christoph