【发布时间】:2016-10-31 11:25:57
【问题描述】:
我开发了一个用 react native 编写的应用程序(用于 IOS),它在 IPV4 网络中运行良好。但是,最近 Apple 发送了一条消息,说我的应用程序在 IPV6 网络中测试时无法运行。他们告诉我,我还必须使其与仅限 IPV6 的网络兼容。
问题是,如何使我现有的 API 调用与 IPV6 网络兼容?
我的 API 使用 https 协议,它是通过域名调用的,而不是原始 IP。
我使用的示例 fetch 调用是:
fetch(query,{
method: 'post',
headers: Utils.fetchHeaders('post')
})
.then(Utils.checkStatus)
.then(Utils.parseJSON)
.then(json => this._handleResponse(json))
.catch(error => {
this.setState({
votingError: 'Sorry, there was an error!',
loading: false
});
});
API 端点采用以下格式:
任何帮助表示赞赏。
【问题讨论】:
标签: ios react-native fetch ipv6