API test with file input returns 201 but empty response body #32945
Unanswered
bharatvir
asked this question in
Questions and Help
Replies: 0 comments
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.
-
Title
API test with file input returns 201 but empty response body
Description
I’m running into an issue when testing an API endpoint with Cypress.
I’m providing a file as input to the API.
The request is processed successfully, and I receive a 201 Created status code.
However, the response body is coming back blank.
Steps to Reproduce
Use cy.request() (or relevant Cypress command) to send a POST request with a file as input.
Observe that the status code is 201.
Check the response body — it’s empty instead of containing the expected payload.
Expected Behavior
The response body should contain the expected JSON or data returned by the API after successful creation.
Actual Behavior
The response body is empty, even though the status code is 201.
Beta Was this translation helpful? Give feedback.
All reactions