Despite using axios and promises to make a call to a local database API, I am facing difficulties reaching the endpoint as I constantly receive a 'Error: Network Error' feedback in the console without any further explanation on the root cause of the issue.
Even though I have correctly specified the endpoint using the android system's localhost
https://10.0.2.2:5001/api/[endpoint]
, accessing this URL in the Chrome browser displays the accurate JSON data, yet the application fails to retrieve it.
The internet permissions have been enabled in the manifest file.
axios
.get('https://10.0.2.2:5001/api/[endpoint]')
.then(response => console.log(response))
.catch(error => console.log(error));