connect-cors icon indicating copy to clipboard operation
connect-cors copied to clipboard

POST request payload

Open kw4n opened this issue 13 years ago • 0 comments

What's the correct way to read POST request payload? I'm using connect-xcors and I can't seem to find where POST payload is stored.

  var server = connect.createServer(
      connect.logger(),
      CORS(options),
      connect.bodyParser(), function(req,res) {
           var foo = req.body.foo; /* this is where bodyParser() stores the payload */
           res.end();
      }
 )

I first thought it was connect.bodyParser() that was messing with me but removing that didn't solve the issue. All help is appreciated.

kw4n avatar Jan 13 '12 11:01 kw4n