我尝试输入带有axios.post的电子邮件并将其发送到后端。它失败并显示:
Request failed with status code 500 node_modules\axios\lib\core\createError.js:16:24 in createError
我的代码:
_onPressButton61 = async () => {
if (this.validate(this.state.userData.email)) {
try {
let result = await axios.post('http://192.168.1.4:3000/users', this.state.userData);
this.props.navigation.navigate('Splash');
console.log(result);
}
catch (err) {
console.log(err);
Alert.alert('This email was used');
}
}
else {
console.log("NU POTI TRECE");
Alert.alert('This email is invalid');
}
}