isomorphic-fetch
isomorphic-fetch copied to clipboard
req.body has set body as property
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?