Skip to content

Instantly share code, notes, and snippets.

@DylanPiercey
Created September 19, 2016 00:22
Show Gist options
  • Save DylanPiercey/0ba29b2f4d1705eeea12d8aa32dbd2b2 to your computer and use it in GitHub Desktop.
Save DylanPiercey/0ba29b2f4d1705eeea12d8aa32dbd2b2 to your computer and use it in GitHub Desktop.
import http from 'http'
http.get('http://www.google.com/index.html', (res) => {
console.log(`Got response: ${res.statusCode}`);
// consume response body
res.resume();
}).on('error', (e) => {
console.log(`Got error: ${e.message}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment