Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

formdata append react js

let formData = new FormData();    //formdata object

formData.append('name', 'ABC');   //append the values with key, value pair
formData.append('age', 20);

const config = {     
    headers: { 'content-type': 'multipart/form-data' }
}

axios.post(url, formData, config)
    .then(response => {
        console.log(response);
    })
    .catch(error => {
        console.log(error);
    });
Comment

PREVIOUS NEXT
Code Example
Javascript :: video preview javascript 
Javascript :: jquery toggle show hide 
Javascript :: jquery capture tab 
Javascript :: javascript remove duplicate letters in a string 
Javascript :: bootstrap in react 
Javascript :: how create an index mongodb 
Javascript :: examples of toastr in jquery 
Javascript :: nodejs check if express started 
Javascript :: navigating programatically react 
Javascript :: jquery validation phone number 
Javascript :: javascript date get nearest 5 minutes 
Javascript :: nodejs json beautify 
Javascript :: remove div by class name javascript 
Javascript :: Read text file in vanilla JS 
Javascript :: set headers in express 
Javascript :: nodejs express hot reload 
Javascript :: jquery array 
Javascript :: postcss.config.js 
Javascript :: zoom out browser javascript 
Javascript :: jquery form validation plugin callback function 
Javascript :: javascript pass all arguments to another function 
Javascript :: javascript count table rows 
Javascript :: Convert from JSON to Python 
Javascript :: How to calc() height in react native for styling 
Javascript :: formik stepper form 
Javascript :: move div with the mouse in js 
Javascript :: start angular app server 
Javascript :: run from build react 
Javascript :: javascript check if is image 
Javascript :: how to make hide/show btn in js 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =