【发布时间】:2016-11-05 09:16:15
【问题描述】:
尝试在带有 axios 的 react-native 下通过 https POST 请求创建用户帐户,而它在 android 上总是失败并出现“网络错误”。
axios('https://'+DEST_URI, {
method: 'post',
data: account,
headers: {
'Accept': 'application/json',
}
then(...)
相同的 https POST 请求在 iOS 上运行良好。
更改为 http,同样的 POST 请求也适用于 android。
还尝试在android上通过https进行GET请求,它可以按预期从后端服务器检索数据。
你知道吗?
链接图像是控制台日志的输出, output from console log
【问题讨论】:
-
您使用的是 Android 设备,如果是,您是否使用 localhost 作为 URI 的一部分?
-
相信您可以轻松回复我的问题:stackoverflow.com/q/48223906/949003谢谢
标签: android post https react-native axios