首页 > 解决方案 > axios 中的网络错误 react native for android

问题描述

嗨,我正在使用 axios 在 react native 中编写一个 get 调用。

当我直接调用部署在 aws 服务器中的以下 api 时,出现网络错误。

https://test.co.in/test/fetchAppFlags/mobilenumber

但是当我调用本地服务器中的 api 并由 ngrok 运行时,我得到了响应。

https://9929cda57b85.ngrok.io/test/fetchAppFlags/mobilenumber

在将我的 api 调用更改为 aws api 时进行上述调用后,我得到了响应。

https://test.co.in/test/fetchAppFlags/mobilenumber

在进行api调用或服务器配置端时,前端是否有任何问题。

谢谢你。

标签: reactjsreact-nativeaxios

解决方案


推荐阅读