Network error in use of axios and fetch in react native

Viewed 1525

I want to use axios in my app project but get this error

network request failed

my code is:

  fetch('https://facebook.github.io/react-native/movies.json').then(function(response) {

      alert(response.data);
  }).catch(function(response) {

      alert(response)

  });

and I tested this but it does not work too

axios:

   Axios.get('https://facebook.github.io/react-native/movies.json').then(function(response) {

   }).catch(function(error) {
       // alert(error)
       console.warn(error)
   });
1 Answers
Related