Home > Net >  axios Post returning error in react native
axios Post returning error in react native

Time:12-12

i am using react native as front-end and backend i have laravel

i am tring to make a axios post request to api my api is working fine in postman

 function getdata() {
    const Data = {
    
      name: name,
      email: email,
      date: mydate,
    };

    console.log(Data);

    axios
      .post('http://127.0.0.1:8000/api/users', Data)

      .then(() => {
      
        alert('success submited');
    
     
      })

      .catch(error => {
        alert(error);
      });
  
  }

error :axiosError:Netwoek Error

CodePudding user response:

insted of using 127.0.0.1 use 10.0.2.2

  • Related