how can I set CSRF TOKEN in my axios request, I've tried this
// axios.defaults.xsrfCookieName = 'csrftoken';
// axios.defaults.xsrfHeaderName = 'X-XSRF-TOKEN';
const tokenApp = window.localStorage.getItem('token')
const { data: res } = await axios.post(`${URL}`, formData, {
withCredentials: true,
xsrfHeaderName: 'X-XSRF-TOKEN',
headers: {
Authorization: `${tokenApp}`,
"Content-Type": "multipart/form-data"
}
});
res.file = `http://20.88.238.192/azure-storage/api/blob/download/?file=${res.nameFile}`;
return res;
but i'm still getting 403 error (forbidden). Do I have to include something else?