For whatever reason the POST req.body would not send through to my API. It was a simple JSON Body object i.e. {"username": "example", "password":"pass"}. At one point I restarted Insomnia and changed around the Body settings and it worked, but then broke again.
๐ Thanks for opening your first issue! If you're reporting a ๐ bug, please make sure
you include steps to reproduce it. If you're requesting a feature ๐, please provide real
use cases that would benefit. ๐ช
To help make this a smooth process, please be sure you have first read the
contributing guidelines.
There should be more info as to what's happening in the Timeline tab.
I am also facing this problem.
Timeline tab:
`* Preparing request to http://localhost:5000/signup
POST /signup HTTP/1.1
Host: localhost:5000
User-Agent: insomnia/6.5.4
Content-Type: application/json
Accept: /
Content-Length: 85
| {
| "name": "test",
| "email": "test",
| "password": "12345453",
| "user_type": "admin"
| }
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Content-Type: application/json; charset=utf-8
< Content-Length: 16
< ETag: W/"10-/VnJyQBB0+b7i4NY83P42KKVWsM"
< Date: Mon, 17 Jun 2019 02:34:00 GMT
< Connection: keep-alive
System Info:

@cashcoder88 I found my problem.
try to add this.express.use(express.json()) in your server :)
๐
Bad post requisitions.
I spent hours reviewing my code just to realize the bug wasn't in my application. You should tell users about the issues software has.
What's the issue the software has, @wellingtonmacena? In my case, I came here after thinking the Insomnia had an issue as well, but then I realized I hadn't included the express.json() middleware in my application - which means Insomnia was fine.
It happened with me. req.body = {} with insomnia, req.body = { content } with postman.
Yah. I had the same! but cleaning the json just settind "No Body" and setting "JSON" again solve my prob! Hope solve yours also!
And I break my head thinkin the error is my code! chears!!!
To me, the problem was sending a "Digest" authentication with a JSON body. I could see on the timeline that the content-length was zero. Once I disabled the authentication, the body was sent.
Most helpful comment
@cashcoder88 I found my problem.
try to add this.express.use(express.json()) in your server :)