mootools/mootools-core — Issue #2316: Request DELETE does not use query string for data
Author: parnham
Created: 2012-02-28 19:18:59+00:00
State: open

When using the Request object for a GET, the data is added to the URL in the form of a query string because GET requests do not have a message body. The same is true of DELETE requests, however the mootools Request object does not add it to the URL but simply leaves the data in the message body which does not then get transmitted/handled by the server.

I propose that this section of the Request send function:

if (data && method == 'get'){
url += (url.contains('?') ? '&' : '?') + data;
data = null;
}

be changed to

if (data && ['get', 'delete'].contains(method)){...