Open renehauck opened 7 years ago
Hi,
i send a post with
fetch(url, { method: 'POST', mode: 'no-cors', redirect: 'follow', body: JSON.stringify({ hello:"world" }), headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded', Accept: 'application/json', }) })
to my (express) server:
this.express.post(Routes.Login, (req, res, next) => { let request = req.body; console.log(request) res.sendStatus(200);
and console.log show this result
{ '{"hello":"world"}': '' }
the stringified object { hello:"world" } is a property of req.body.
Is this a bug, or what I am doing wrong?
Thx
It's been a while since I used express but what you've described doesn't seem unexpected to me. What did you expect to happen in this case?
Hi,
i send a post with
to my (express) server:
and console.log show this result
the stringified object { hello:"world" } is a property of req.body.
Is this a bug, or what I am doing wrong?
Thx