I have webix upload form in my app. But when I try to upload with api in console I have error 400 bad request (Invalid json message received). I need to have in my request header “multipart/form-data” when i try to upload but I always have application/json in my request header. In my application i have code like this in the beginning :
webix.attachEvent(“onBeforeAjax”, function(mode, url, data, request, headers){
headers[“Authorization”]= CookieService.get(‘token’);
headers[“Content-type”]= “application/json”;
});
As I can see i cannot override content-type. Do you have any idea how can I change content type only when I try to upload documents (somehow to attach event to the upload button) to change content type only when this upload occurs.
Thank you in advance.