axios react post form data
axios({
method: 'post',
url: 'myurl',
data: bodyFormData,
headers: {'Content-Type': 'multipart/form-data' }
})
.then(function (response) {
//handle success
console.log(response);
})
.catch(function (response) {
//handle error
console.log(response);
});var body = {
userName: 'Fred',
userEmail: '[email protected]'
}
axios({
method: 'post',
url: '/addUser',
data: body
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
Also in JavaScript:
- duplicate encoder
- create 2d array in javascript filled with 0
- react scrolling a div by dragging the mouse?
- Programação web com Node e Express Beneficiando-se da stack JavaScript
- javascript variable shortcuts
- React microphone
- javascript array last element
- object traversal javascript
- Function to convert an Array to an Associative array
- how to use javascript to get full file path
- leaflet draw save event
- how to convert entered number into currency in words in javascript
- scroll jquery to anchor
- js filter items by index
- anagram program in javascript
- create element javascript with class
- input type number max value validation
- kill all node process ubunut
- question mark and colon in javascript
- Convert from JSON to Python
- javascript href on load delay
- js stop form submit on enter
- objeto con método javascript
- javascript check if string contains a text substring