Why is the request body of my Cypress Post request empty? #24971
Unanswered
ricardo-molina
asked this question in
Questions and Help
Replies: 1 comment
-
I was able to replicate your issue with a basic express app and copying your The issue seems to be your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am writing a Cypress test for my Node backend API.
The test sends a POST request with some headers and body, which includes some required parameters for the backend to work with (
productId
,requestorEmail
, ...).The strange thing is that the endpoint is just receiving an empty request.body.
This is what my Cypress test looks like, you can see how I send the request body:
In case it matters, these are the headers I'm sending :
When running the tests, Cypress says:
The request we sent was: ... Body: {"productId":"10519", "requestorEmail":"[email protected]"}
.The endpoint that receives this call is, afaik, pretty standard Node and Express code.
Any idea why I am not receiving anything inside the
request.body
in the backend? I've already been a couple days banging my head against the wall with this issue. Any help is appreciated :)Beta Was this translation helpful? Give feedback.
All reactions