On before ajax listener

Hi, I wanted to set header of request. Following code sets the header:

webix.attachEvent("onBeforeAjax", (mode, url, data, request, headers, files, promise) => {
if (url.includes("import") || url.includes("uploadFile")) {
headers["X-Auth-Token"] = getToken(); }
});

However, it cannot catch this url in the listener above
http://localhost:8081/api/files/downloadFile/1/qqq.svg

Tagged:

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!