Advertisement
hackerboxes

node send get request

Aug 18th, 2013
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. var http = require('http');
  2. var options = {
  3. host: 'www.google.com',
  4. path: '/index.html'
  5. };
  6.  
  7. http.get(options, function(res) {
  8. console.log('STATUS: ' + res.statusCode);
  9. console.log('HEADERS: ' + JSON.stringify(res.headers));
  10. }).on('error', function(e) {
  11. console.log('ERROR: ' + e.message);
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement