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 ...'}
});
sending api request in axios with files
let headers = {
Authorization: "token",
'Content-Type':'multipart/form-data'
};
let formData = new FormData();
for(let key in files){
formData.append('files[][file]', files[key].file, files[key].file.name)
formData.append('files[][file_type_id]', files[key].fileType)
}
axios
.post(
"/api/files",
formData,
{ headers }
)
.then(()=>{console.log('It Works')})
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