Skip to content

Instantly share code, notes, and snippets.

@gahabeen
Last active January 30, 2017 17:58
Show Gist options
  • Save gahabeen/40e4b617f4f60d09cffeef615b6a6514 to your computer and use it in GitHub Desktop.
Save gahabeen/40e4b617f4f60d09cffeef615b6a6514 to your computer and use it in GitHub Desktop.
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