In react native iOS build getting timeout error when requesting api, It was working fine in iOS 14.4 but after that it was getting timeout error randomly
In react native iOS build getting timeout error randomly when requesting api, It was working fine in iOS 14.4 but after that it was getting timeout error randomly.
Description
I'm using axios library for api request,When I hit api then it is taking longer time in iOS real device compare to android and simulator,I'm getting (finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out.")in Xcode
React Native version:
"react": "16.13.1",
"react-native": "0.63.2",
Snack, code example, screenshot, or link to a repository:
import Axios from 'axios';
const axios = Axios.create({
baseURL: BASE_URL,
timeout: 90000,
headers: {
'Content-Type': 'application/json',
},
validateStatus: function (status) {
return status == 200;
}
});
componentDidMount = async()=>{
let key = new FormData();
key.append("key","xyzwrtychbcvdvhdbjscsjdd");
let headers = { 'Content-Type': 'multipart/form-data' }
const result = await axios.post(${baseURL},key, { headers: headers });
}
我也遇到了 同样的情况

我也遇到了 同样的情况
@xiaoliuxiansheng Did you find any solution ?
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.