0๐
โ
I have found the answer in the syntax:
api({
method: "POST",
url: "/webdata",
data: doc,
})
.then((result) => {
console.log("result: ", result);
})
.catch((e) => {
console.log("e: ", e);
});
I removed the "headers: { Authorization: basicAuth }," and "headers: { "content-type": "application/json" }," I had already added it in the axios config.
Also, I made sure I had an _id inside the doc.
Source:stackexchange.com