I have a problem with this error:
Access to XMLHttpRequest at 'https://...' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
POST https://... net::ERR_FAILED
I am trying to send data but getting a "CORS" error
Am I missing something?
Here is my code
var dataBlob = File;
const submit = async () => {
//Convert Blob URL to file object with axios
const config = { responseType: blob };
await axios.get(mediaBlobUrl, config).then((response) => {
dataBlob = new File([response.data], record, { type: media });
});
let formdata = new FormData();
formdata.append(sequence, L);
formdata.append(video, dataBlob);
console.log(data, dataBlob);
//POST
try {
console.log(formdata.getAll);
let result = await axios({
url: https://abc...,
method: POST,
data: formdata,
});
console.log(result.data);
} catch (err) {
console.log(err);
}