Simplified XMLHttpRequest shadow (tested on 5.5, 6 and 7); Introduced preprocess...
[jquery.git] / src / ajax / ajaxTest.js
index 98f7cfc..a84df1d 100644 (file)
@@ -277,4 +277,21 @@ test("$.ajax - xml: non-namespace elements inside namespaced elements", function
            start();
          }
        });
+});
+
+test("$.ajax - preprocess", function() {
+       expect(1);
+       stop();
+       var customHeader = "value-for-custom-header";
+       $.ajax({
+               url: "data/name.php", 
+               data: {'req': true},
+               preprocess: function(xml) {
+                       xml.setRequestHeader('customHeader', customHeader)
+               },
+               success: function(data) {
+                       ok( data == customHeader, "check return value, should be the custom header sent" );
+                       start();
+               }
+       });
 });
\ No newline at end of file