webix ajax send Formdata object

Hi webix Team,

I was using webix ajax call like
webix.ajax().post(‘updateProjectDetails’,{
id: id,
updatedData: updatedData,
},)

but Now I want to send formdata object,
so I tried this
var formdata=new FormData();
webix.ajax().post(‘updateProjectDetails’,formdata
},)

It is working well with parameters,
but As I have changed json object with formdata, I am getting 403 forbidden status code,
if I replace formdata with json it is working well, but I am using formdata to send file data(object)

How can I solve this issue?

Please reply!
Thank you.

Hello @Prarthana,

How can I solve this issue?

The 403 error code tells me that the issue is most likely related to the way your server handles such requests (containing FormData). The same example works well with our backend: https://snippet.webix.com/3vnx0aye (you can check the request status by going into your DevTools - Network tab - Headers, the status code is 200 in this case).

As a workaround, you could try converting your FormData object into a standart JSON object - https://snippet.webix.com/ded1x40t.