I am working in a react-native application. Here, I am getting [AxiosError: Network Error]
in the android emulator, while calling my application specific APIs (which is hosted). But it works fine in the real android device.
Please check the below code block (App.js)
useEffect(() => {
const body = {
"user_name": "U2FsdGVkX1/mr+86bJTglYk2BIL9H4GmjwfpxEfQiPI=",
"password": "U2FsdGVkX1/pzNiKbuSRB5Kuk1Y/mwXKjEfwxbw/4p8="
}
const axiosConfig = {
headers: {
'Content-Type': 'application/json',
}
};
axios.post('https://staging.myapp.in:3010/users/login', body, axiosConfig)
.then((res) => {
console.log("RESPONSE RECEIVED: ", res.data);
})
.catch((err) => {
console.log("AXIOS ERROR: ", err);
})
})
LOG coming from catch block, please check the below log screen. Error message doesn’t contain other info apart from the message.
But I get the proper response in the android real device. Please check the below image