Opened 10 years ago

Closed 6 years ago

#15122 closed defect (patchwelcome)

XHR PUT – Content-Type is always "text/xml" when putData is a Document on IE

Reported by: Randy Hudson Owned by: Bryan Forbes
Priority: undecided Milestone: 1.13
Component: IO Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


IE always uses "text/xml" content type when the putData is an XML document. The fix is to convert the document to a string.

Change History (2)

comment:1 Changed 10 years ago by curtispd

Some more specifics..

This applies to dojo.xhrPut() with a MSXML DOM Document object as the putData. I specified a header, "application/rdf+xml" to specify the Content-Type, but the request that actually goes out uses "text/xml". I couldn't find a way to get around this other than serialize the XML DOM to a string first and send it as text.


if (dojo.isIE) {
	 * 113794: IE automatically overrides the Content-Type header to "text/xml"
	 * when a Document is used as putData. Convert to string beforehand so we get
	 * the right content type.
	putData = dojox.xml.parser.innerXML(putData);

I guess if it's an IE defect, dojo could provide a similar workaround in dojo.xhrPut.

comment:2 Changed 6 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

I doubt this is still relevant, but if it is with dojo/request, please reopen.

Note: See TracTickets for help on using tickets.