Generation

generate functionTue, 21 Mar 2023

Send data using axios

import axios from 'axios'; // axios.post('http://localhost:8080', { // firstName: 'Fred', // lastName: 'Flintstone' // }) // .then(function (response) { // console.log(response); // }) // .catch(function (error) { // console.log(error); // }); axios.post('/user', { firstName: 'Fred', lastName: 'Flintstone' }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); // axios({ // method: 'post', // url: 'http://localhost:8080/user', // data: { // firstName: 'Fred', // lastName: 'Flintstone' // } // }); // axios.post('/user', { // firstName: 'Fred', // lastName:

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant