raj
raj

Reputation: 346

how to get values in form-data from postman addon nodejs express

I am using node js with express framework, restful api. I want to post values using 'form-data' option in postman addon.

I am able to post values using the x-www-form-urlencoded option and am able to get values like req.body.username, req.body.email, etc. This is working fine, but I need 'form-data' option also.

If I use "form-data" option then I am not able to get the post values please help me how to get values using this option 'form-data' in postman addon.

Upvotes: 4

Views: 3865

Answers (2)

zain- Ul-abidin
zain- Ul-abidin

Reputation: 1

Use req.fields and use 'express-formidable' to get form-data from postman.

Upvotes: 0

Tobias Lins
Tobias Lins

Reputation: 2651

I just tried postman. It sends the header as content type multipart/form-data.

You need another package to handle that.

They are linked in body-parser repo at the top. For example: busboy, multiparty

Upvotes: 2

Related Questions