I am calling api through fetch in react native but its throwing following error:
network request failed
- node_modules\whatwg-fetch\fetch.js:439:29 in onerror
- node_modules\event-target-shim\lib\event-target.js:172:43 in dispatchEvent
- node_modules\react-native\Libraries\Network\XMLHttpRequest.js:567:29 in setReadyState
- node_modules\react-native\Libraries\Network\XMLHttpRequest.js:397:25 in __didCompleteResponse
- node_modules\react-native\Libraries\Network\XMLHttpRequest.js:503:16 in
- node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:180:12 in emit
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:351:47 in __callFunction
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:116:26 in
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314:6 in __guardSafe
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:115:17 in callFunctionReturnFlushedQueue
Our front end code is on localhost while the APIs are on server. I am using react native at front end and Django at back end.