I just updated from jQuery 1.3.2 to 1.4.3, and I'm seeing some new behavior when making AJAX DELETE requests. For some reason, the data being passed in my data
parameter is not being sent to the server. For example:
$.ajax({
url: '/example',
data: {id: 12},
type: 'DELETE'
});
Ends up sending a DELETE request to /example
with no additional data. However, this type of call passes the parameters just fine:
$.ajax({
url: '/example?id=12',
type: 'DELETE'
});
Has anyone else seen similar behavior? Is there a reason this is no longer working (i.e.: is it by design, or is it a bug)? Any suggestions on how to get it working?
Also, in case anyone is wondering why I don't simply want to pass the parameters as part of the URL string, it's because I'm ultimately attempting to use the $.ajaxSetup
callback, providing some general parameters there (namely the authenticity_token
parameter used to protect against forgery in Rails). This all worked fine prior to trying jQuery 1.4.3.