Skip to content
Permalink
Browse files

Fixing request data param issue. Thanks to mislav for the patch. Fixe…

…s #5123.
  • Loading branch information
jeresig committed Jun 15, 2010
1 parent c34a62f commit c90d609c0d10a8792b0b31e226592fd707f45570
Showing with 15 additions and 1 deletion.
  1. +1 −1 src/ajax.js
  2. +1 −0 test/data/echoData.php
  3. +13 −0 test/unit/ajax.js
@@ -484,7 +484,7 @@ jQuery.extend({

// Send the data
try {
xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
xhr.send( (type !== "GET" && s.data) || null );

} catch( sendError ) {
jQuery.ajax.handleError( s, xhr, null, e );
@@ -0,0 +1 @@
<?php echo file_get_contents('php://input'); ?>
@@ -1163,6 +1163,19 @@ test("data option: evaluate function values (#2806)", function() {
})
});

test("data option: empty bodies for non-GET requests", function() {
stop();
jQuery.ajax({
url: "data/echoData.php",
data: undefined,
type: "post",
success: function(result) {
equals( result, "" );
start();
}
})
});

test("jQuery.ajax - If-Modified-Since support", function() {
expect( 3 );

0 comments on commit c90d609

Please sign in to comment.
You can’t perform that action at this time.