Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Created August 7, 2012 05:54
Show Gist options
  • Save heapwolf/3282135 to your computer and use it in GitHub Desktop.
Save heapwolf/3282135 to your computer and use it in GitHub Desktop.
http/requests
var inspect = require('util').inspect;
require('http').createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
var inspected = {
'url': req.url,
'method': req.method,
'headers': req.headers
};
res.end(inspect(inspected));
}).listen(4001);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment