api - 在邮递员中获取 api 工作,但在本机反应中不工作
问题描述
我想在 react native 中获取我的 api,但 react 不显示我的结果,此 api 显示在邮递员中但不显示在 react native 中,在我更改我的 api 后这对我有用但不显示此 api。我的代码是:
fetch('http://roomarket.ir/LlIi1/CT.php')
.then((response13) => response13.json())
.then((response3) => {
this.setState({Alert.alert(response3.ENtime)})
我如何在本机反应中获取它请帮助我
解决方案
尝试这个。
fetch('http://roomarket.ir/LlIi1/CT.php')
.then((response) => response.json())
.then((responseData) => {
this.setState({response:responseData. ENtime},() => Alert.alert(this.state.response))
推荐阅读
- reactjs - 努力使用 rails 后端、react + redux 前端实现设计用户角色
- c++ - 如何在编译时将 std::views::join 结果转换为 string_view?
- python - 在 Linux 服务器上运行烧瓶应用程序时连接失败
- swift - Agora RTM 登录出现超时错误代码 9?
- apache - 将 Apache SSI 与 SPA 路由结合使用
- bash - 用于从键值过滤值的 Bash 脚本
- python - 创建一个抽象类属性装饰器
- javascript - Javascript 警报延迟 jquery .remove 操作
- java - java中的url编码有撇号和空格的问题
- javascript - JavaScript Express - 如何接受动态表单请求