1let formData = new FormData(); //formdata object
2
3formData.append('name', 'ABC'); //append the values with key, value pair
4formData.append('age', 20);
5
6const config = {
7 headers: { 'content-type': 'multipart/form-data' }
8}
9
10axios.post(url, formData, config)
11 .then(response => {
12 console.log(response);
13 })
14 .catch(error => {
15 console.log(error);
16 });
17