Service Authentication

So, I’m using Elixir on the backend, with token based authentication. My question is, with regard to data collections, can I add a header to calls setup in the simple fashion here:

var collection = new webix.DataCollection({
url:“rest->/records”,
save:“rest->/records”
});

I essentially need to add an Authorisation header passing the token as value.

Thanks,
Lee

My guess is you have to use a custom proxy based on the rest proxy.
See: http://docs.webix.com/desktop__server_proxy.html

Yes, proxy is the solution:

webix.proxy.myProxy = webix.extend({
     load:function(view, callback){
         webix.ajax().headers({
            "Authorization": "..."
         }).get(url).then(function(data){ 
             var records = data.json();
             webix.ajax.$callback(view, callback, "", records, -1);
         }); 
     }
}, webix.proxy.rest);

var collection = new webix.DataCollection({ 
       url:"myProxy->/records", 
       save:"myProxy->/records" 
});

Thank you, Helga. I’ll give that a go.

@Helga thank you helga.
But how can I send extra parameters to the “url” of the DataCollection?

I have a search form to filter a grid, after compiling the form, Iit should call a restws and then fill the grid.
I’m using a DataCollection object into a model.
in this moment I have a function that makes the ajax call, and then I parse the return object into a DataCollection.

How can I handle a proxy in this scenario?