Last active
January 30, 2017 17:58
-
-
Save gahabeen/40e4b617f4f60d09cffeef615b6a6514 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
let axios = require('axios'); | |
axios.get('https://www.producthunt.com') // HTTP request to https://www.producthunt.com | |
.then((response) => { // Success case | |
if(response.status === 200) { // If HTTP Response is 200 - All good | |
let html = response.data; // Setting the reponse.data to html | |
} // to make things clear | |
}, (error) => { | |
console.log("Humm: ", error); // Shouldn't be triggered ;) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment