我是 React Native 的新手,我有 node.js 项目。当我在本地运行 node.js 项目并尝试通过 fetch/axios 方法与 react native 连接时,出现此错误。
[TypeError: Network request failed]
我的api调用函数是,
const URL = 'http://localhost:4545/User/SignUp'
const getMe = () => {
fetch(URL)
.then(response => response.json())
.then(json => console.log('>>>>>>>\n\n\n\n',json,'\n\n\n\n<<<<<<<<'))
.catch((e =>console.log('>>>>>>>\n\n\n\n',e,'\n\n\n\n<<<<<<<<')))
}
这里出了什么问题 先谢谢了!!