Created
February 9, 2019 13:45
-
-
Save realabbas/7969c6f7b5d0cd22befdf94311341fc6 to your computer and use it in GitHub Desktop.
How to use axios in React
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
import axios from 'axios'; | |
const request = () =>{ | |
axios.get('yourendpoint/query') | |
.then(function (response){ | |
console.log(response); | |
}) | |
.catch(function (error){ | |
console.log(error); | |
}); | |
} | |
// further program |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment