Я пытаюсь добавить станции, используя API открытой погоды, и делаю пост-запрос, используя axios
const stationData={
external_id:this.state.external_id,
name:this.state.name,
latitude:this.state.latitude,
longitude:this.state.longitude,
altitude:this.state.altitude,
}
const url = `http://api.openweathermap.org/data/3.0/stations?appid=${ApiKey}`;
var headers = {
'Content-Type': 'application/json;charset=UTF-8',
"Access-Control-Allow-Origin": "*"
}
axios.post(url, data, {headers: headers}).then((response)=>{
console.log("response is " + response);
}).catch((err)=>{
console.log("error is " + err);
})
но это дает мне ошибку
OPTIONS http://api.openweathermap.org/data/3.0/stations?APPID=2747592557924542516e283a7f905a81 404 (Not Found)
Failed to load http://api.openweathermap.org/data/3.0/stations?APPID=2747592557924542516e283a7f905a81: Response for preflight does not have HTTP ok status.
error is Error: Network Error
Если я использую Почтальона для отправки запроса на почту, он работает там, любая помощь, пожалуйста ??