类型错误网络请求在React Native 0.63.2 Android中失败

时间:2020-10-01 11:53:33

标签: reactjs react-native api

当我尝试调用api时,我正在React Native中工作- [类型错误]网络错误。

我正在寻找解决方案,您能帮我解决吗?

axios.post('https://mydomain/upload_video.php',JSON.stringify({

          content: this.state.message,

          video_url: 'myvideo_url'

        }),{
         headers:{

          'Accept': 'application/json',
          'Content-Type': 'application/json', 
         }
        }).then((res)=>{
          console.log(res.data);
          

        }).catch((error)=>{
          console.error( error) ;
        })

0 个答案:

没有答案