Created
August 7, 2012 05:54
-
-
Save heapwolf/3282135 to your computer and use it in GitHub Desktop.
http/requests
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
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