openweather api中的发布站给出了网络错误

时间:2018-09-17 17:13:04

标签: javascript reactjs axios openweathermap

我正在尝试将站添加到openweather api,但是我一直在获取网络错误。邮递员也可以使用

  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);
              })

    the error is 

选项http://api.openweathermap.org/data/3.0/stations?appid=2747592557924542516e283a7f905a81 404(未找到)      无法加载http://api.openweathermap.org/data/3.0/stations?appid=2747592557924542516e283a7f905a81:飞行前响应没有HTTP正常状态。 AddStation.js?59a0:60错误是错误:网络错误

0 个答案:

没有答案