Commit c90d609c authored by jeresig's avatar jeresig

Fixing request data param issue. Thanks to mislav for the patch. Fixes #5123.

parent c34a62f8
...@@ -484,7 +484,7 @@ jQuery.extend({ ...@@ -484,7 +484,7 @@ jQuery.extend({
// Send the data // Send the data
try { try {
xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null ); xhr.send( (type !== "GET" && s.data) || null );
} catch( sendError ) { } catch( sendError ) {
jQuery.ajax.handleError( s, xhr, null, e ); jQuery.ajax.handleError( s, xhr, null, e );
......
<?php echo file_get_contents('php://input'); ?>
...@@ -1163,6 +1163,19 @@ test("data option: evaluate function values (#2806)", function() { ...@@ -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() { test("jQuery.ajax - If-Modified-Since support", function() {
expect( 3 ); expect( 3 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment