When i send request with my Google Cloud address from postman its ok but from android studio/react-native/axios its give an error.
[Error: Network Error]
This is my code:
constructor(props){
super(props);
this.state = {
email: '',
password: '',
error: '',
loading: false
};
}
handleLoginUser(){
const { email, password } = this.state;
this.setState({ error: '', loading: true });
axios.post("https://serverip/users/login",
{
'email': 'email',
'password': 'password'
},
{
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json; charset=utf-8',
},
}
)
.then(response => {
console.log(response);
return response.json();})
.then(data => {
if (result.success){
alert("Login successful");
}
else
alert("Unable to Login");
})
.catch((error) => {
console.log(error);
});
}
Thanks for your helps.