Created
October 8, 2018 16:31
-
-
Save andijakl/0584c1d2caa83b0c7a536a2049008c0a to your computer and use it in GitHub Desktop.
Example for the "Callback Hell" with chained web requests
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
request("https://www.andreasjakl.com/wp-content/uploads/2018/08/arcore-anchors.gif", function(error, response, body) { | |
if (error) { | |
// Handle error | |
console.log("Error: ", error); | |
} else { | |
if (response && response.statusCode == 200) { | |
request("https://www.andreasjakl.com/wp-content/uploads/2018/08/SLAM-HoloLens-2000x1163.jpg", function(error, response, body) { | |
if (error) { | |
console.log("Error: ", error); | |
} else { | |
console.log("status code:" , response && response.statusCode); | |
} | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment