【发布时间】:2021-10-06 18:17:09
【问题描述】:
enter image description here 请看一下img,我尝试使用它,但它的效果不好,我不明白为什么
<Formik
initialValues={{email: "", password: "", firstname: "",
lastname: "", passwordConfirm: ""}}
onSubmit={(values, {setSubmitting}) => {
console.log(values);
// Send a POST r`enter code here`equest
axios.post('http://212.42.212.29:3001/auth/register', values, {
"headers": {
"content-type": "application/json",
}
}).then(function (response) {
console.log(response);
}).catch(function (error) {
console.log(error.response);
});
}}
>
【问题讨论】:
-
400 - 错误请求。确保您提供了正确的端点并检查后端是否正在运行
标签: javascript reactjs api axios formik