Last active
February 22, 2019 16:53
-
-
Save jbis9051/549afac745aa58210bb981c0d780c97a to your computer and use it in GitHub Desktop.
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
<div className={"right-align"}> | |
<Tool className={"confirm-btn"} icon={"fas fa-check"} | |
onClick={() => this.beginDownload()}/> | |
</div> | |
[...] | |
beginDownload() { | |
[...] | |
this.setState({downloads: [...this.state.downloads, new Download()]}); | |
[...] | |
} | |
[...] | |
export default class Download { | |
constructor() { | |
[...] | |
new Promise(resolve => { | |
var options = {method: 'HEAD', host: 'stackoverflow.com', port: 443, path: '/'}; | |
var req = https.request(options, function (res) { | |
console.log("in the request"); | |
//console.log(res); | |
//resolve(res.headers['content-length']); | |
console.log(JSON.stringify(res.headers)); | |
res.on("data",res => { | |
console.log(JSON.stringify(res)); | |
}) | |
} | |
); | |
req.end(); | |
}); | |
} | |
[...] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment