Created
September 21, 2018 10:22
-
-
Save DanielRamosAcosta/b9a3c352b3938fb33d0fbc45204d72a1 to your computer and use it in GitHub Desktop.
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
| import axios from "https://gist.githubusercontent.com/DanielRamosAcosta/2f773d815f5434f185c59aec1bab418c/raw/a442cdd8699e39ab9855cbaa571a79049a7b67d4/axios.ts" | |
| // Make a request for a user with a given ID | |
| axios.get('http://jsonplaceholder.typicode.com/users/1') | |
| .then(response => { | |
| // handle success | |
| console.log("User name:", response.data.name); | |
| }) | |
| .catch(error => { | |
| // handle error | |
| console.error("error:", error); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment