Created
October 8, 2018 16:10
-
-
Save andijakl/47d015a40b3a5630cbac27a9d226236c to your computer and use it in GitHub Desktop.
JavaScript Callback Example using Node.js and the request module
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
const request = require("request"); | |
request("https://www.andreasjakl.com/", function(error, response, body) { | |
if (error) { | |
// Handle error | |
console.log("Error: ", error); | |
} else { | |
// Successful request | |
console.log("body: ", body); | |
} | |
}); | |
console.log("Starting..."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment