Last active
May 2, 2017 08:29
-
-
Save AshRhazaly/287df37884b2cdcd7702a146ff5cf6ee to your computer and use it in GitHub Desktop.
react fetching data using AXIOS
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
| Documentation | |
| ### https://github.com/mzabriskie/axios | |
| // Installing axios & using it | |
| 1. Type "npm install --save axios" in terminal | |
| 2. import axios from 'axios'; | |
| // A GET response in axios | |
| axios.get('http://api.giphy.com/v1/gifs/trending?api_key=dc6zaTOxFJmzC') | |
| .then(response => { | |
| }) | |
| .catch(error => { | |
| console.log('Error fetching and parsing data', error); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment