【发布时间】:2018-01-07 18:09:02
【问题描述】:
我目前面临网络请求失败的错误。
这是我的代码:
fetch("https://nextbus.comfortdelgro.com.sg/eventservice.svc/BusStops")
.then((response) => response.json())
.then((responseJSON) => {
console.log("JSON",responseJSON)
})
.catch((error) => {
console.error(error);
});
我正在构建一个 iOS 应用程序,我已经编辑了 info.plist 文件
<key>nextbus.comfortdelgro.com.sg/eventservice.svc/BusStops</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
我的网址是 HTTPS,所以我不明白为什么会遇到这个错误。
【问题讨论】:
标签: ios react-native fetch react-native-ios