axios send post data
// Send a POST request
axios({
method: 'post',
url: '/user/12345',
data: {
firstName: 'Fred',
lastName: 'Flintstone'
},
headers: {'Authorization': 'Bearer ...'}
});
axios send post data
// Send a POST request
axios({
method: 'post',
url: '/user/12345',
data: {
firstName: 'Fred',
lastName: 'Flintstone'
},
headers: {'Authorization': 'Bearer ...'}
});
how to use post method axios
const handleClick = async () => {
let fd = new FormData();
fd.append("name", name);
fd.append("password", password);
const rep = await axios
.post("http://localhost/php/api/students/create.php", fd)
.catch((err) => {
console.log(err, "axios error");
});
console.log(rep.data);
};
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us