Created
September 5, 2018 09:22
-
-
Save bsingr/aee788f660a2840d286fd2259c9bc47d to your computer and use it in GitHub Desktop.
node-issue-https-request
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
require('https').get({ | |
host: 'example.com', | |
port: 443, | |
path: '/foo/bar', | |
url: url | |
}, res => { | |
res.setEncoding("utf8"); | |
let body = ""; | |
res.on("data", data => { | |
body += data; | |
}); | |
res.on("end", () => { | |
console.log( | |
body | |
); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment