I am trying to run a delete query with react js. In Postman my delete query is working, but in my code it says no Authorization
I did
console.log(headers)
to check if header is available but still it's not working. I have posted what I have tried
const deletefile = (e) => {
const headers = {
Authorization: `Token ${sessionStorage.getItem("token")}`,
};
console.log(headers);
const Data = {
id: e,
// // stage: "stage9",
// notes: notes,
};
axios
.delete("file/", Data, {
headers: headers,
})
.then(() => {
alert("success submited");
// setRefresh(Refresh + 1);
})
.catch((error) => {
alert(error);
});


sessionStorage.getItem("token")and can you show how did you test in postman (may be a screenshot) ?