-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't get req.body #381
Comments
I don't see also, please post the code using fenced code blocks, that way others can copy and search the code. Like so:
|
I just use console.log(req.body); So I see is {} |
Your code screenshot doesn't show how it's all called so this is impossible for me to debug. Could you provide a minimum erring test case? |
if your file input element is in the top of form then every data below that gets assigned to req.body after your image is uploaded, in the result of which body remains empty while you upload photo.. So take file input element to very bottom of your form so that req.body will have data from other input elements |
What solved it for me was making sure the "Content-Type" header information in postman was not set; it had been set to "application/x-www-form-urlencoded" and removing allowed me to receive the file on my backend server as well as the req.body values. |
I have solved and I will close this issues. sorry for last reply |
Hi, I use multer to upload file and I want to attach other parameter in request In postman like this
my code
So I can't get req.body.test_body , How do I fix this??
The text was updated successfully, but these errors were encountered: