View Full Version : Why does Connect.setOptions() not allow parameters for method === 'DELETE' ?

21 Sep 2012, 10:32 AM
So, spent some time trying to make a very specific API/REST call using Extjs 4.1 today. This particular server side call require parameters be passed with DELETE.

Discovered that Ext.data.Connect.setOptions() only appends parameters to the url IF the following is true:

from: extjs-4.1.1\src\data\Connection.js, starting on line 546:

if ((method == 'GET' || data) && params) {
url = Ext.urlAppend(url, params);
params = null;

I recognize there are allot of way's to read the RESTfulness (or lack thereof) about parameter passing to methods such as DELETE. But the RFC's are silent on parameters for methods such as DELETE, HEAD, OPTIONS, TRACE, etc.... So I'm not sure why the code does not read more like:

if (params) {
url = Ext.urlAppend(url, params);
params = null;

Inquiring minds would like to know.

NOTE: I'm not looking to ask 'how do I pass parameters' to DELETE. I recognize one could just hand write the url and manually append the parameters. This is more of a 'getting into the mindset of Sencha developers' question.

22 Sep 2012, 7:26 AM
Here's another question.
Why is Connection.js using Ext.urlAppend() when documentation says it's DEPRECATED?