I have an angularjs app posting over https to a node express server. The angular client is posting with the header:
headers: {'Content-Type': 'application/x-www-form-urlencoded'}})
On the server:
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({
extended: false
}));
This produces a request body that looks like:
{ '{"firstname":"hj","lastname":"hj"}': '' }
Without bodyParser I don't get any body at all.
Obviously I'm doing something wrong. Is there a way to get valid json without trying to unscramble the above request body?