die();\r
}\r
$request = apache_request_headers();\r
-$request = $request['customHeader'];\r
+$request = $request['X-Custom-Header'];\r
if(strlen($request) > 0) {\r
echo $request;\r
die();\r
* (Boolean) async - By default, all requests are send asynchronous (set to true).
* If you need synchronous requests, set this option to false.
*
- * (Function) before - A pre-callback to set custom headers etc., the
+ * (Function) beforeSend - A pre-callback to set custom headers etc., the
* XMLHttpRequest is passed as the only argument.
*
* @example $.ajax({
contentType: "application/x-www-form-urlencoded",
processData: true,
async: true,
- before: null
+ beforeSend: null
}, s);
// if data available
xml.setRequestHeader("Connection", "close");
// Allow custom headers/mimetypes
- if( s.before )
- s.before(xml);
+ if( s.beforeSend )
+ s.beforeSend(xml);
// Wait for a response to come back
var onreadystatechange = function(isTimeout){
test("$.ajax - preprocess", function() {
expect(1);
stop();
- var customHeader = "value-for-custom-header";
+ var customHeader = "value";
$.ajax({
url: "data/name.php",
data: {'req': true},
- before: function(xml) {
- xml.setRequestHeader('customHeader', customHeader)
+ beforeSend: function(xml) {
+ xml.setRequestHeader('X-Custom-Header', customHeader);
},
success: function(data) {
ok( data == customHeader, "check return value, should be the custom header sent" );