Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created October 8, 2018 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andijakl/47d015a40b3a5630cbac27a9d226236c to your computer and use it in GitHub Desktop.
Save andijakl/47d015a40b3a5630cbac27a9d226236c to your computer and use it in GitHub Desktop.
JavaScript Callback Example using Node.js and the request module
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