Skip to content

Instantly share code, notes, and snippets.

@demian85
Created August 7, 2011 16:15
Show Gist options
  • Save demian85/1130500 to your computer and use it in GitHub Desktop.
Save demian85/1130500 to your computer and use it in GitHub Desktop.
var util = require('util'),
http = require('http'),
connect = require('connect'),
express = require('express');
var app = express.createServer();
app.configure(function(){
app.use(express.bodyParser());
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.all('/', function(req, res, next) {
console.log("params:");
console.log(req.params);
console.log('body:')
console.log(req.body);
res.send("Response!");
});
app.listen(8080);
// requesting http://localhost:8080/?a=9 via GET / POST
// prints...
// params:
// []
// body:
// undefined
@DTrejo
Copy link

DTrejo commented Aug 8, 2011

Last ditch effort:
console.log(require('util').inspect(req, null, false));

And then wade through a page of information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment