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

React Native Network Error GET request not working

$
0
0

I have been have an issue , sending a request (with axios) to my nodejs server is not working

enter image description here

here is the code

onPressLogin = () => {
    axios
      .post(
        'http://192.168.1.201:3000/v1/user/login',
        qs.stringify({
          email: this.state.email,
          password: this.state.password,
        }),
      )
      .then(res => {
        console.log(res)
        if (res.status === 200) {
          this.props.navigation.navigate('HomeScreen')
        } else {
          alert('Erreur de connexion')
        }
      })
      .catch(error => {
        console.error(error)
      })
      .done()
  }

I used 10.0.2.2 , my host IP adress(works with postman) but no result on the app


Viewing all articles
Browse latest Browse all 29776

Latest Images

Trending Articles



Latest Images

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