Search code examples
react-nativepermissionsgetaxiosexpo

GET request permissions error with React native expo and express server


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" }


Solution

  • 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