Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to send form data from react to express

const reactData = [{ id: 1, name:' Tom'}, { id: 2, name:' Sarah'}];
const url = localhost:4000/api/users/register;

let sendData = () => {
axios.post(url, reactData)
   .then(res => console.log('Data send'))
   .catch(err => console.log(err.data))
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #send #form #data #react #express
ADD COMMENT
Topic
Name
6+3 =