Reputation: 23
I'm calling a GET request with axios in my React Native EXPO app but getting a NETWORK ERROR consoled in my terminal. I can make request to my Express server from my web browser but not my RN app.
I added this to my app.json file as I do to my React apps, but I'm not sure what the issue is. Any help is much appreciated. Thanks guys.
{ "expo": { ... }, "proxy": "https://localhost:7000" }
Upvotes: 0
Views: 337
Reputation: 23
I figured it out! So I tried using axios.get("/") and axios.get("http://locahost:{PORT}/") and still had no luck but using axios.get("http://192.168.x.x:{PORT}/") worked. Looks like I need to use my local host IP adress to make API calls. I also removed the proxy script in my app.json
Upvotes: 1