Ad

Expo Fetching Link To Returning Network Request Error Or Promise Object

- 1 answer

1- the vs code has 2 fetch codes:

the first fetch code always turns on an error, network request failed as the emulator in the screen

the second fetch is to GitHub link that returns JSON formatted data and no errors there

2- the browser:

the browser clearly shows that link retrieve data correctly, and I tested on Postman, and it retrieves it, but in fetch it doesn't happen.. Notice that the failed fetch to local host server..

If I tried fetch without "then" it will return:

Promise { "_40": 0, "_55": null, "_65": 0, "_72": null, }

notes:

I am using Golang as backend using revel framework, and I have put the headers while sending data but I suppose that the backend is correct and had nothing to do with the fetch error.

Ad

Answer

after I edit my Fetch URL everything become well

the URL was http://127.0.0.1:9000

after I edit it to my IPv4 on my network

http://192.168.1.104:9000

everything has done , hope to help someone.

Ad
source: stackoverflow.com
Ad