André Warnier wrote:
To me thus, the "correct" way - and the only way a browser would do it - to POST this data, would be in the form of a multipart/form-data body, itself composed of a MIME header and a body that would be the XML blob.

If I may:

       function loadXMLDoc(xmlRequest) {
               var xmlDoc;
               xmlDoc = new window.XMLHttpRequest();
               xmlDoc.open("POST", parent.serverURL, false);
               xmlDoc.setRequestHeader("Content-type", "text/xml");
xmlDoc.setRequestHeader("Content-length", xmlRequest.length);
               xmlDoc.setRequestHeader("Connection", "close");
               xmlDoc.send(xmlRequest);
               return xmlDoc.responseXML;
       }



(Yes, I know I'm doing doing the proper HTTP status return checks. This is very rough code at the moment.)

I went with this for two reasons: one, it is absurdly simple and two, there is no required encoding. If I want to send a blob of data, then I'm going to send a blob of data. I saw a really simple, easy way out of encoding (sometimes /very/) long strings into the proper urlencoded form. I pass in an XML string, I get an XML string back - no extra effort involved. Granted, the getParameter*() methods are there for a reason. I just chose not to use them.

My point, is that it is entirely possible for a browser to POST data to a resource without sending it as multipart/form-data or application/x-www-form-urlencoded.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to