Friday 9 June 2017

Body as form data in node.js is undefined through postman Mongodb

I am trying to do a post request to the server through form-data, but i need two fields to be added as body.

I have to add the following fields in my body:

sporter - type: text

file - type: file

But when i do: console.log(body.req.file) or console.log(body.req.sporter) both return undefined. I know i can fix it by using raw json, but is there a way to input the binary file through postman? Because you cant do it with raw json. Or is there a way to make the form-data work?



via Markie Doe

No comments:

Post a Comment