Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

react native axios request not working in IOS simulator

$
0
0

I am trying to getting data from API using axios.

This is my code that makes a get request :

export const loadBloodGroups = () => {    return (dispatch) => {        dispatch({ type: LOADING_BLOOD });        const url = `http://www.example.org/api/bloodgroup/getusersbloodgroup`;        axios.get(url)        .then(response => loadingSuccess(dispatch, response))        .catch(error => loadingFail(dispatch, error));    };};const loadingFail = (dispatch, error) => {    console.log(error);    dispatch({         type: LOADING_BLOOD_FAIL,        payload: error    });};const loadingSuccess = (dispatch, response) => {    dispatch({        type: LOADING_BLOOD_SUCCESS,         payload: response    });}; 

info.plist setup for http :

enter image description here

It works fine in android emulator, but IOS simulator is not working.

In my browser debug console it shows :

enter image description here

and Mac terminal it shows :

enter image description here

Can anybody tell me, where I made mistake ? or should I need to do any other configuration for IOS?

My platform:

  • OS: Mac 10.13
  • node: 10.7
  • npm: 6.3.0
  • react: 16.4.1
  • react-native: 0.55

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>