javascript - HTTPS 请求在 ios simualtor 上不起作用
问题描述
我在 react-native 中完成了我的应用程序的编码,并且在 expo 应用程序中一切正常(我可以登录并使用该应用程序)但是当我构建应用程序并在 xcode 中启动它时,似乎我的 HTTPS 请求不起作用。它卡在加载模式并且请求不起作用。
下面是示例请求:
export const fetchUserLoginToken = async (props) => {
let userCredentials = await fetch('https://xxxx', {
method: 'POST',
body: JSON.stringify({
"username": `${props.username}`,
"password": `${props.password}`
}),
headers: {
'Content-Type': 'application/json',
}
})
.then(data => data.json())
.then(data => {
return data
})
return userCredentials
}
有什么解决办法吗?提前致谢
解决方案
推荐阅读
- c# - 上传文件 Selenium UI 测试不适用于 Dynamics 365 门户
- oracle - 将 Oracle .dmp 文件加载到 Hive
- c++ - 使用 CMake(Visual Studio 2015)构建的可执行文件需要 Qt5SVG.dll,但原始 Visual Studio 2015 不需要。为什么?
- excel - 我的宏在我的 csv .txt 输出的末尾创建了一个回车,但不知道为什么
- nginx - Nginx上游和监听同一个端口
- jenkins - 如何在 Jenkins Scripted Pipeline 中设置多行参数化 cron 作业?
- python - 如何修复'错误:asyncio:任务已被破坏,但它正在等待处理!Python中的错误
- python - 在基于城市/位置将函数应用于熊猫时如何避免 20 多个 if 语句
- php - 如何获取网站的元属性并将值存储到变量中?
- colors - 是否有数字是彩色的 MNIST 数据集?