Код: Выделить всё
method.response.header.Access-Control-Allow-Headers ='Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'
method.response.header.Access-Control-Allow-Methods ='OPTIONS,POST'
method.response.header.Access-Control-Allow-Origin = '*'
Код: Выделить всё
try {
const response = await fetch(API_URL, {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
begin_date: beginDate.value,
end_date: endDate.value
})
});
Подробнее здесь: https://stackoverflow.com/questions/798 ... ght-errors