webix.ajax array 'params'

Hi!
I’m trying to send to a server an array of objects as the ‘params’ parameter:

webix.ajax().post(url, params, callback);

with something like this:

var pars = {field1: “A”, field2: “B”};
webix.ajax().sync().post(MyURL, [params], function …

I got no errors, the error callback function is NOT called, but neither the succes function is :frowning:

if I use something like:

webix.ajax().sync().post(MyURL, params, function …

the server complains (correctly) about the wrong parameters, and the error callback function is called.

So in short the question is:
is the sending of parameters in form of array supported by webix.ajax?

Thanks in advance!

If you are using “sync()” there will be no callback. Sync operation will return the server-side response. Callbacks will work only for async. calls.

Hi Maksim, thank you for your quick reply!

I tryed both form of calls (sync and async) with the same result. I Posted the sync() form because was the last tryed :slight_smile:

Shall I assume that you think that the ‘params’ as array should not be a problem?

I have checked the code, and there is really a problem with an array as argument of the post method :frowning:

//this one will work
webix.ajax().post(url, { a:1, b:2 });

//this one will not work
webix.ajax().post(url, [1,2]);

//this one will work again
webix.ajax().post(url, JSON.stringify([1,2]));

//and this one will work as well
webix.ajax().post(url, { data:  [1,2] });

Maksim, this is what I call ‘support’!