Created
February 9, 2021 12:14
-
-
Save sabesansathananthan/86ad5443741b3a970e34b8e14a0d6f0c to your computer and use it in GitHub Desktop.
Axios Vs Fetch
This file contains hidden or 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
axios({ | |
method: 'post', | |
url: '/login', | |
timeout: 5000, // 5 seconds timeout | |
data: { | |
firstName: 'Sabesan', | |
lastName: 'Sathananthan' | |
} | |
}) | |
.then(response => {/* handle the response */}) | |
.catch(error => console.error('timeout exceeded')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment