[OpenLayers-Commits] r2067 - in sandbox/vector/lib/OpenLayers: . Writer

commits at openlayers.org commits at openlayers.org
Fri Dec 15 10:31:39 EST 2006


Author: crschmidt
Date: 2006-12-15 10:31:37 -0500 (Fri, 15 Dec 2006)
New Revision: 2067

Modified:
   sandbox/vector/lib/OpenLayers/Ajax.js
   sandbox/vector/lib/OpenLayers/Writer/WFS.js
Log:
Update AJAX to support passed contenttype, and update Writer to send one.


Modified: sandbox/vector/lib/OpenLayers/Ajax.js
===================================================================
--- sandbox/vector/lib/OpenLayers/Ajax.js	2006-12-15 14:36:51 UTC (rev 2066)
+++ sandbox/vector/lib/OpenLayers/Ajax.js	2006-12-15 15:31:37 UTC (rev 2067)
@@ -231,9 +231,9 @@
       ['X-Requested-With', 'XMLHttpRequest',
        'X-Prototype-Version', 'OpenLayers'];
 
-    if (this.options.method == 'post') {
+    if (this.options.method == 'post' ) {
       requestHeaders.push('Content-type',
-        'application/x-www-form-urlencoded');
+        this.options.contenttype ? this.options.contenttype : 'application/x-www-form-urlencoded' );
 
       /* Force "Connection: close" for Mozilla browsers to work around
        * a bug where XMLHttpReqeuest sends an incorrect Content-length

Modified: sandbox/vector/lib/OpenLayers/Writer/WFS.js
===================================================================
--- sandbox/vector/lib/OpenLayers/Writer/WFS.js	2006-12-15 14:36:51 UTC (rev 2066)
+++ sandbox/vector/lib/OpenLayers/Writer/WFS.js	2006-12-15 15:31:37 UTC (rev 2067)
@@ -52,6 +52,7 @@
         new OpenLayers.Ajax.Request("/geoserver/wfs/transaction", 
                                     {
                                         method: 'post', 
+                                        contenttype: 'text/xml', 
 //                                        parameters: '<?xml version="1.0" ?>' + OpenLayers.serializeXMLNode(transaction)
                                           parameters: transaction,
                                           onComplete: onSuccess, 



More information about the Commits mailing list