Last active
October 5, 2020 06:45
-
-
Save ting11222001/b457364fe3479fadf719916115a8b3e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# terminal: | |
$npm install axios | |
import axios from 'axios'; | |
... | |
onSubmit(e){ | |
e.preventDefault(); | |
const device = { | |
accountname: this.state.accountname, | |
description: this.state.description, | |
duration: this.state.duration, | |
date: this.state.date | |
}; | |
axios.post('http://52.198.4.100:5000/devices/add', device) | |
.then(res => console.log(res.data)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment