I\'m using the fetch API in my react-native Android app to make requests to a local API. I usually query said API from react web apps at http://localhost:8163.
I\'m t
Had the same/similar issue - took me two full days to solve it. I use a Win10 machine with Visual Studio Code, attached Android device and a local PHP server for API. Maybe this will help somebody:
fetch('http://{your IP}:8081/')
.then((response) => response.json())
.then((responseJson) => {
this.setState({ message : responseJson.message.data })
})
.catch((error) => {
console.error(error);
});