Axios在android中出现网络错误。在IOS工作。
用法
axios.post('.../manualauth/login', {
email: this.state.email,
password: this.state.password,
remember: ""
})
.then(function (response) {
console.log(response);
this.validate_response(response);
}.bind(this))
.catch(function (error) {
alert('connection error');
console.log(error);
console.log(error.response.data);
if (error.response) {
console.log(error.response.data);
// console.log(error.response.status);
// console.log(error.response.headers);
}
});
错误:
Error: Network Error
at createError (createError.js:16)
at XMLHttpRequest.handleError (xhr.js:87)
at XMLHttpRequest.dispatchEvent (event-target.js:172)
at XMLHttpRequest.setReadyState (XMLHttpRequest.js:546)
at XMLHttpRequest.__didCompleteResponse (XMLHttpRequest.js:381)
at XMLHttpRequest.js:485
at RCTDeviceEventEmitter.emit (EventEmitter.js:181)
at MessageQueue.__callFunction (MessageQueue.js:250)
at MessageQueue.js:101
Axios在Android中突然停止工作但在IOS中工作。
这是关于HTTPS问题的吗?