Skip to content

Instantly share code, notes, and snippets.

@peterjgrainger
Created October 21, 2021 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterjgrainger/9315d3c52f3e1d759736fe50a1d12873 to your computer and use it in GitHub Desktop.
Save peterjgrainger/9315d3c52f3e1d759736fe50a1d12873 to your computer and use it in GitHub Desktop.
Headers
var http = require('http');
//create a server object:
http.createServer(function (req, res) {
res.write(JSON.stringify(req.headers)); //write a response to the client
res.end(); //end the response
}).listen(3000); //the server object listens on port 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment